From: support
Date: Tue, 21 Jun 2022 07:41:30 +0000 (+0000)
Subject: Built motion from commit ee312f6f.|2.6.11
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%201101license.mail?a=commitdiff_plain;h=9b7ef19a7c1a83cdb9973025e521630988c31163;p=motion2.git
Built motion from commit ee312f6f.|2.6.11
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 6a453cc..15c992c 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-06-20T15:33:31.928Z",
+ "time": "2022-06-21T07:33:12.595Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index bb4d5ef..ea2b315 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-06-20T15:33:31.928Z",
+ "time": "2022-06-21T07:33:12.595Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/legacy-libs/@grpc/proto-loader/package.json b/legacy-libs/@grpc/proto-loader/package.json
index f2f6658..0322287 100644
--- a/legacy-libs/@grpc/proto-loader/package.json
+++ b/legacy-libs/@grpc/proto-loader/package.json
@@ -1,28 +1,4 @@
{
- "_from": "@grpc/proto-loader@^0.4.0",
- "_id": "@grpc/proto-loader@0.4.0",
- "_inBundle": false,
- "_integrity": "sha512-Jm6o+75uWT7E6+lt8edg4J1F/9+BedOjaMgwE14pxS/AO43/0ZqK+rCLVVrXLoExwSAZvgvOD2B0ivy3Spsspw==",
- "_location": "/@grpc/proto-loader",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "@grpc/proto-loader@^0.4.0",
- "name": "@grpc/proto-loader",
- "escapedName": "@grpc%2fproto-loader",
- "scope": "@grpc",
- "rawSpec": "^0.4.0",
- "saveSpec": null,
- "fetchSpec": "^0.4.0"
- },
- "_requiredBy": [
- "/google-gax"
- ],
- "_resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.4.0.tgz",
- "_shasum": "a823a51eb2fde58369bef1deb5445fd808d70901",
- "_spec": "@grpc/proto-loader@^0.4.0",
- "_where": "/home/vito/Development/MOTION_V2/CUSTOM_PKGS/dfnode8/node_modules/google-gax",
"author": {
"name": "Google Inc."
},
diff --git a/legacy-libs/@protobufjs/aspromise/package.json b/legacy-libs/@protobufjs/aspromise/package.json
index e8f1b6f..ea1ec8f 100644
--- a/legacy-libs/@protobufjs/aspromise/package.json
+++ b/legacy-libs/@protobufjs/aspromise/package.json
@@ -1,51 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/aspromise@^1.1.2",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2faspromise",
- "name": "@protobufjs/aspromise",
- "rawSpec": "^1.1.2",
- "spec": ">=1.1.2 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/aspromise@>=1.1.2 <2.0.0",
- "_id": "@protobufjs/aspromise@1.1.2",
- "_inCache": true,
- "_location": "/@protobufjs/aspromise",
- "_nodeVersion": "6.9.1",
- "_npmOperationalInternal": {
- "host": "packages-18-east.internal.npmjs.com",
- "tmp": "tmp/aspromise-1.1.2.tgz_1493030312365_0.014110192423686385"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "4.0.5",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/aspromise@^1.1.2",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2faspromise",
- "name": "@protobufjs/aspromise",
- "rawSpec": "^1.1.2",
- "spec": ">=1.1.2 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/@protobufjs/fetch",
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
- "_shasum": "9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/aspromise@^1.1.2",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/base64/package.json b/legacy-libs/@protobufjs/base64/package.json
index 22b27e7..82e4167 100644
--- a/legacy-libs/@protobufjs/base64/package.json
+++ b/legacy-libs/@protobufjs/base64/package.json
@@ -1,50 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/base64@^1.1.2",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2fbase64",
- "name": "@protobufjs/base64",
- "rawSpec": "^1.1.2",
- "spec": ">=1.1.2 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/base64@>=1.1.2 <2.0.0",
- "_id": "@protobufjs/base64@1.1.2",
- "_inCache": true,
- "_location": "/@protobufjs/base64",
- "_nodeVersion": "8.0.0",
- "_npmOperationalInternal": {
- "host": "s3://npm-registry-packages",
- "tmp": "tmp/base64-1.1.2.tgz_1497000720755_0.053681070916354656"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "5.0.1",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/base64@^1.1.2",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2fbase64",
- "name": "@protobufjs/base64",
- "rawSpec": "^1.1.2",
- "spec": ">=1.1.2 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
- "_shasum": "4c85730e59b9a1f1f349047dbf24296034bb2735",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/base64@^1.1.2",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/codegen/package.json b/legacy-libs/@protobufjs/codegen/package.json
index dde2069..3e800ea 100644
--- a/legacy-libs/@protobufjs/codegen/package.json
+++ b/legacy-libs/@protobufjs/codegen/package.json
@@ -1,50 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/codegen@^2.0.4",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2fcodegen",
- "name": "@protobufjs/codegen",
- "rawSpec": "^2.0.4",
- "spec": ">=2.0.4 <3.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/codegen@>=2.0.4 <3.0.0",
- "_id": "@protobufjs/codegen@2.0.4",
- "_inCache": true,
- "_location": "/@protobufjs/codegen",
- "_nodeVersion": "8.0.0",
- "_npmOperationalInternal": {
- "host": "s3://npm-registry-packages",
- "tmp": "tmp/codegen-2.0.4.tgz_1497041777758_0.900342388311401"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "5.0.1",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/codegen@^2.0.4",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2fcodegen",
- "name": "@protobufjs/codegen",
- "rawSpec": "^2.0.4",
- "spec": ">=2.0.4 <3.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
- "_shasum": "7ef37f0d010fb028ad1ad59722e506d9262815cb",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/codegen@^2.0.4",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/eventemitter/package.json b/legacy-libs/@protobufjs/eventemitter/package.json
index 4abce6b..dd23e64 100644
--- a/legacy-libs/@protobufjs/eventemitter/package.json
+++ b/legacy-libs/@protobufjs/eventemitter/package.json
@@ -1,50 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/eventemitter@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2feventemitter",
- "name": "@protobufjs/eventemitter",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/eventemitter@>=1.1.0 <2.0.0",
- "_id": "@protobufjs/eventemitter@1.1.0",
- "_inCache": true,
- "_location": "/@protobufjs/eventemitter",
- "_nodeVersion": "6.9.1",
- "_npmOperationalInternal": {
- "host": "packages-18-east.internal.npmjs.com",
- "tmp": "tmp/eventemitter-1.1.0.tgz_1485367943950_0.18555008037947118"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "4.0.5",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/eventemitter@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2feventemitter",
- "name": "@protobufjs/eventemitter",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
- "_shasum": "355cbc98bafad5978f9ed095f397621f1d066b70",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/eventemitter@^1.1.0",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/fetch/package.json b/legacy-libs/@protobufjs/fetch/package.json
index 5b1214d..26781bf 100644
--- a/legacy-libs/@protobufjs/fetch/package.json
+++ b/legacy-libs/@protobufjs/fetch/package.json
@@ -1,50 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/fetch@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2ffetch",
- "name": "@protobufjs/fetch",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/fetch@>=1.1.0 <2.0.0",
- "_id": "@protobufjs/fetch@1.1.0",
- "_inCache": true,
- "_location": "/@protobufjs/fetch",
- "_nodeVersion": "6.9.1",
- "_npmOperationalInternal": {
- "host": "packages-12-west.internal.npmjs.com",
- "tmp": "tmp/fetch-1.1.0.tgz_1485532253082_0.3777743794489652"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "4.0.5",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/fetch@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2ffetch",
- "name": "@protobufjs/fetch",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
- "_shasum": "ba99fb598614af65700c1619ff06d454b0d84c45",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/fetch@^1.1.0",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/float/package.json b/legacy-libs/@protobufjs/float/package.json
index 7ee37d1..9cf9766 100644
--- a/legacy-libs/@protobufjs/float/package.json
+++ b/legacy-libs/@protobufjs/float/package.json
@@ -1,50 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/float@^1.0.2",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2ffloat",
- "name": "@protobufjs/float",
- "rawSpec": "^1.0.2",
- "spec": ">=1.0.2 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/float@>=1.0.2 <2.0.0",
- "_id": "@protobufjs/float@1.0.2",
- "_inCache": true,
- "_location": "/@protobufjs/float",
- "_nodeVersion": "6.9.1",
- "_npmOperationalInternal": {
- "host": "packages-12-west.internal.npmjs.com",
- "tmp": "tmp/float-1.0.2.tgz_1491129941022_0.6265034212265164"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "4.0.5",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/float@^1.0.2",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2ffloat",
- "name": "@protobufjs/float",
- "rawSpec": "^1.0.2",
- "spec": ">=1.0.2 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
- "_shasum": "5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/float@^1.0.2",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/inquire/package.json b/legacy-libs/@protobufjs/inquire/package.json
index a91b63f..f5bbe1a 100644
--- a/legacy-libs/@protobufjs/inquire/package.json
+++ b/legacy-libs/@protobufjs/inquire/package.json
@@ -1,51 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/inquire@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2finquire",
- "name": "@protobufjs/inquire",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/inquire@>=1.1.0 <2.0.0",
- "_id": "@protobufjs/inquire@1.1.0",
- "_inCache": true,
- "_location": "/@protobufjs/inquire",
- "_nodeVersion": "6.9.1",
- "_npmOperationalInternal": {
- "host": "packages-12-west.internal.npmjs.com",
- "tmp": "tmp/inquire-1.1.0.tgz_1485367981156_0.06349746254272759"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "4.0.5",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/inquire@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2finquire",
- "name": "@protobufjs/inquire",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/@protobufjs/fetch",
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
- "_shasum": "ff200e3e7cf2429e2dcafc1140828e8cc638f089",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/inquire@^1.1.0",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/path/package.json b/legacy-libs/@protobufjs/path/package.json
index a699e67..43236f4 100644
--- a/legacy-libs/@protobufjs/path/package.json
+++ b/legacy-libs/@protobufjs/path/package.json
@@ -1,50 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/path@^1.1.2",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2fpath",
- "name": "@protobufjs/path",
- "rawSpec": "^1.1.2",
- "spec": ">=1.1.2 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/path@>=1.1.2 <2.0.0",
- "_id": "@protobufjs/path@1.1.2",
- "_inCache": true,
- "_location": "/@protobufjs/path",
- "_nodeVersion": "6.9.1",
- "_npmOperationalInternal": {
- "host": "packages-12-west.internal.npmjs.com",
- "tmp": "tmp/path-1.1.2.tgz_1487868856921_0.727851988747716"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "4.0.5",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/path@^1.1.2",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2fpath",
- "name": "@protobufjs/path",
- "rawSpec": "^1.1.2",
- "spec": ">=1.1.2 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
- "_shasum": "6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/path@^1.1.2",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/pool/package.json b/legacy-libs/@protobufjs/pool/package.json
index 119d282..6885887 100644
--- a/legacy-libs/@protobufjs/pool/package.json
+++ b/legacy-libs/@protobufjs/pool/package.json
@@ -1,50 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/pool@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2fpool",
- "name": "@protobufjs/pool",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/pool@>=1.1.0 <2.0.0",
- "_id": "@protobufjs/pool@1.1.0",
- "_inCache": true,
- "_location": "/@protobufjs/pool",
- "_nodeVersion": "6.9.1",
- "_npmOperationalInternal": {
- "host": "packages-18-east.internal.npmjs.com",
- "tmp": "tmp/pool-1.1.0.tgz_1485367998862_0.3938121625687927"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "4.0.5",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/pool@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2fpool",
- "name": "@protobufjs/pool",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
- "_shasum": "09fd15f2d6d3abfa9b65bc366506d6ad7846ff54",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/pool@^1.1.0",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/@protobufjs/utf8/package.json b/legacy-libs/@protobufjs/utf8/package.json
index 916a7c6..57784c7 100644
--- a/legacy-libs/@protobufjs/utf8/package.json
+++ b/legacy-libs/@protobufjs/utf8/package.json
@@ -1,50 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "@protobufjs/utf8@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2futf8",
- "name": "@protobufjs/utf8",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/protobufjs"
- ]
- ],
- "_from": "@protobufjs/utf8@>=1.1.0 <2.0.0",
- "_id": "@protobufjs/utf8@1.1.0",
- "_inCache": true,
- "_location": "/@protobufjs/utf8",
- "_nodeVersion": "6.9.1",
- "_npmOperationalInternal": {
- "host": "packages-18-east.internal.npmjs.com",
- "tmp": "tmp/utf8-1.1.0.tgz_1485368134514_0.7150300552602857"
- },
- "_npmUser": {
- "name": "dcode",
- "email": "dcode+npm@dcode.io"
- },
- "_npmVersion": "4.0.5",
- "_phantomChildren": {},
- "_requested": {
- "raw": "@protobufjs/utf8@^1.1.0",
- "scope": "@protobufjs",
- "escapedName": "@protobufjs%2futf8",
- "name": "@protobufjs/utf8",
- "rawSpec": "^1.1.0",
- "spec": ">=1.1.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/protobufjs"
- ],
- "_resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
- "_shasum": "a777360b5b39a1a2e5106f8e858f2fd2d060c570",
- "_shrinkwrap": null,
- "_spec": "@protobufjs/utf8@^1.1.0",
- "_where": "/var/opt/motion2/node_modules/protobufjs",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/legacy-libs/google-proto-files/package.json b/legacy-libs/google-proto-files/package.json
index 96141ec..26ad205 100644
--- a/legacy-libs/google-proto-files/package.json
+++ b/legacy-libs/google-proto-files/package.json
@@ -1,51 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "google-proto-files@^0.20.0",
- "scope": null,
- "escapedName": "google-proto-files",
- "name": "google-proto-files",
- "rawSpec": "^0.20.0",
- "spec": ">=0.20.0 <0.21.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/google-gax"
- ]
- ],
- "_from": "google-proto-files@>=0.20.0 <0.21.0",
- "_hasShrinkwrap": false,
- "_id": "google-proto-files@0.20.0",
- "_inCache": true,
- "_location": "/google-proto-files",
- "_nodeVersion": "8.15.0",
- "_npmOperationalInternal": {
- "host": "s3://npm-registry-packages",
- "tmp": "tmp/google-proto-files_0.20.0_1552683029562_0.24857841381622836"
- },
- "_npmUser": {
- "name": "google-node-team",
- "email": "node-team-npm@google.com"
- },
- "_npmVersion": "6.4.1",
- "_phantomChildren": {},
- "_requested": {
- "raw": "google-proto-files@^0.20.0",
- "scope": null,
- "escapedName": "google-proto-files",
- "name": "google-proto-files",
- "rawSpec": "^0.20.0",
- "spec": ">=0.20.0 <0.21.0",
- "type": "range"
- },
- "_requiredBy": [
- "/google-gax"
- ],
- "_resolved": "https://registry.npmjs.org/google-proto-files/-/google-proto-files-0.20.0.tgz",
- "_shasum": "dfcd1635a0c3f00f49ca057462cf369108ff4b5e",
- "_shrinkwrap": null,
- "_spec": "google-proto-files@^0.20.0",
- "_where": "/var/opt/motion2/node_modules/google-gax",
"author": {
"name": "google-proto-files project authors"
},
diff --git a/legacy-libs/grpc-cloned/package.json b/legacy-libs/grpc-cloned/package.json
index 64a79e3..c5b692f 100644
--- a/legacy-libs/grpc-cloned/package.json
+++ b/legacy-libs/grpc-cloned/package.json
@@ -1,63 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "grpc@1.24.6",
- "scope": null,
- "escapedName": "grpc",
- "name": "grpc",
- "rawSpec": "1.24.6",
- "spec": "1.24.6",
- "type": "version"
- },
- "/var/opt/motion2"
- ]
- ],
- "_from": "grpc@1.24.6",
- "_hasShrinkwrap": false,
- "_id": "grpc@1.24.6",
- "_inCache": true,
- "_location": "/grpc",
- "_nodeVersion": "12.18.1",
- "_npmOperationalInternal": {
- "host": "s3://npm-registry-packages",
- "tmp": "tmp/grpc_1.24.6_1615411862636_0.20920405911456452"
- },
- "_npmUser": {
- "name": "murgatroid99",
- "email": "mlumish@google.com"
- },
- "_npmVersion": "6.14.5",
- "_phantomChildren": {
- "ascli": "1.0.1",
- "bytebuffer": "5.0.1",
- "decamelize": "1.2.0",
- "glob": "7.0.6",
- "os-locale": "1.4.0",
- "string-width": "1.0.2",
- "strip-ansi": "3.0.1",
- "wrap-ansi": "2.1.0",
- "y18n": "3.2.1"
- },
- "_requested": {
- "raw": "grpc@1.24.6",
- "scope": null,
- "escapedName": "grpc",
- "name": "grpc",
- "rawSpec": "1.24.6",
- "spec": "1.24.6",
- "type": "version"
- },
- "_requiredBy": [
- "/",
- "/google-gax",
- "/grpc-gcp"
- ],
- "_resolved": "https://registry.npmjs.org/grpc/-/grpc-1.24.6.tgz",
- "_shasum": "1862a9d990f79cfa20b962d77f090000d915469c",
- "_shrinkwrap": null,
- "_spec": "grpc@1.24.6",
- "_where": "/var/opt/motion2",
"author": {
"name": "Google Inc."
},
diff --git a/legacy-libs/grpc/package.json b/legacy-libs/grpc/package.json
index 9d191ad..93916c7 100644
--- a/legacy-libs/grpc/package.json
+++ b/legacy-libs/grpc/package.json
@@ -1,52 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "grpc@1.22",
- "scope": null,
- "escapedName": "grpc",
- "name": "grpc",
- "rawSpec": "1.22",
- "spec": ">=1.22.0 <1.23.0",
- "type": "range"
- },
- "/home/vito/Development/MOTION_V2/CUSTOM_PKGS/test"
- ]
- ],
- "_from": "grpc@>=1.22.0 <1.23.0",
- "_hasShrinkwrap": false,
- "_id": "grpc@1.22.3",
- "_inCache": true,
- "_location": "/grpc",
- "_nodeVersion": "10.12.0",
- "_npmOperationalInternal": {
- "host": "s3://npm-registry-packages",
- "tmp": "tmp/grpc_1.22.3_1566244154383_0.07155258037766044"
- },
- "_npmUser": {
- "name": "murgatroid99",
- "email": "mlumish@google.com"
- },
- "_npmVersion": "6.4.1",
- "_phantomChildren": {},
- "_requested": {
- "raw": "grpc@1.22",
- "scope": null,
- "escapedName": "grpc",
- "name": "grpc",
- "rawSpec": "1.22",
- "spec": ">=1.22.0 <1.23.0",
- "type": "range"
- },
- "_requiredBy": [
- "#USER",
- "/"
- ],
- "_resolved": "https://registry.npmjs.org/grpc/-/grpc-1.22.3.tgz",
- "_shasum": "19eb6f9308e793ecc57d6d9b534369ce98b0a137",
- "_shrinkwrap": null,
- "_spec": "grpc@1.22",
- "_where": "/home/vito/Development/MOTION_V2/CUSTOM_PKGS/test",
"author": {
"name": "Google Inc."
},
diff --git a/legacy-libs/json-bigint/package.json b/legacy-libs/json-bigint/package.json
index 6d3e2c7..a7818f6 100644
--- a/legacy-libs/json-bigint/package.json
+++ b/legacy-libs/json-bigint/package.json
@@ -1,51 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "json-bigint@^0.3.0",
- "scope": null,
- "escapedName": "json-bigint",
- "name": "json-bigint",
- "rawSpec": "^0.3.0",
- "spec": ">=0.3.0 <0.4.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/gcp-metadata"
- ]
- ],
- "_from": "json-bigint@>=0.3.0 <0.4.0",
- "_hasShrinkwrap": false,
- "_id": "json-bigint@0.3.1",
- "_inCache": true,
- "_location": "/json-bigint",
- "_nodeVersion": "12.13.0",
- "_npmOperationalInternal": {
- "host": "s3://npm-registry-packages",
- "tmp": "tmp/json-bigint_0.3.1_1592365825784_0.15984931652351175"
- },
- "_npmUser": {
- "name": "sidorares",
- "email": "sidorares@yandex.com"
- },
- "_npmVersion": "6.12.0",
- "_phantomChildren": {},
- "_requested": {
- "raw": "json-bigint@^0.3.0",
- "scope": null,
- "escapedName": "json-bigint",
- "name": "json-bigint",
- "rawSpec": "^0.3.0",
- "spec": ">=0.3.0 <0.4.0",
- "type": "range"
- },
- "_requiredBy": [
- "/gcp-metadata"
- ],
- "_resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.1.tgz",
- "_shasum": "0c1729d679f580d550899d6a2226c228564afe60",
- "_shrinkwrap": null,
- "_spec": "json-bigint@^0.3.0",
- "_where": "/var/opt/motion2/node_modules/gcp-metadata",
"author": {
"name": "Andrey Sidorov",
"email": "sidorares@yandex.ru"
diff --git a/legacy-libs/protobufjs/package.json b/legacy-libs/protobufjs/package.json
index ce8fb29..d9d7169 100644
--- a/legacy-libs/protobufjs/package.json
+++ b/legacy-libs/protobufjs/package.json
@@ -1,55 +1,4 @@
{
- "_args": [
- [
- {
- "raw": "protobufjs@^6.8.0",
- "scope": null,
- "escapedName": "protobufjs",
- "name": "protobufjs",
- "rawSpec": "^6.8.0",
- "spec": ">=6.8.0 <7.0.0",
- "type": "range"
- },
- "/var/opt/motion2/node_modules/dialogflow"
- ]
- ],
- "_from": "protobufjs@>=6.8.0 <7.0.0",
- "_hasShrinkwrap": false,
- "_id": "protobufjs@6.10.2",
- "_inCache": true,
- "_location": "/protobufjs",
- "_nodeVersion": "10.22.0",
- "_npmOperationalInternal": {
- "host": "s3://npm-registry-packages",
- "tmp": "tmp/protobufjs_6.10.2_1605561394120_0.8578340673118987"
- },
- "_npmUser": {
- "name": "google-wombot",
- "email": "node-team-npm+wombot@google.com"
- },
- "_npmVersion": "6.14.6",
- "_phantomChildren": {},
- "_requested": {
- "raw": "protobufjs@^6.8.0",
- "scope": null,
- "escapedName": "protobufjs",
- "name": "protobufjs",
- "rawSpec": "^6.8.0",
- "spec": ">=6.8.0 <7.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/@grpc/proto-loader",
- "/dialogflow",
- "/google-gax",
- "/google-proto-files",
- "/grpc-gcp"
- ],
- "_resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.10.2.tgz",
- "_shasum": "b9cb6bd8ec8f87514592ba3fdfd28e93f33a469b",
- "_shrinkwrap": null,
- "_spec": "protobufjs@^6.8.0",
- "_where": "/var/opt/motion2/node_modules/dialogflow",
"author": {
"name": "Daniel Wirtz",
"email": "dcode+protobufjs@dcode.io"
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 6a3ffd9..224f778 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -22,11 +22,6 @@
"from": "@types/body-parser@*",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz"
},
- "@types/bytebuffer": {
- "version": "5.0.43",
- "from": "@types/bytebuffer@>=5.0.40 <6.0.0",
- "resolved": "https://registry.npmjs.org/@types/bytebuffer/-/bytebuffer-5.0.43.tgz"
- },
"@types/connect": {
"version": "3.4.35",
"from": "@types/connect@*",
@@ -47,11 +42,6 @@
"from": "@types/geojson@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz"
},
- "@types/long": {
- "version": "4.0.2",
- "from": "@types/long@*",
- "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz"
- },
"@types/mime": {
"version": "1.3.2",
"from": "@types/mime@>=1.0.0 <2.0.0",
@@ -82,11 +72,6 @@
"from": "abab@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz"
},
- "abbrev": {
- "version": "1.1.1",
- "from": "abbrev@>=1.0.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz"
- },
"abort-controller": {
"version": "3.0.0",
"from": "abort-controller@>=3.0.0 <4.0.0",
@@ -205,11 +190,6 @@
"from": "append-field@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz"
},
- "aproba": {
- "version": "1.2.0",
- "from": "aproba@>=1.0.3 <2.0.0",
- "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz"
- },
"archiver": {
"version": "2.1.1",
"from": "archiver@2.1.1",
@@ -227,11 +207,6 @@
"from": "archiver-utils@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz"
},
- "are-we-there-yet": {
- "version": "1.1.7",
- "from": "are-we-there-yet@>=1.1.2 <1.2.0",
- "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz"
- },
"argparse": {
"version": "1.0.10",
"from": "argparse@>=1.0.7 <2.0.0",
@@ -289,11 +264,6 @@
"from": "asap@*",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz"
},
- "ascli": {
- "version": "1.0.1",
- "from": "ascli@>=1.0.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz"
- },
"asn1": {
"version": "0.2.6",
"from": "asn1@>=0.2.4 <0.3.0",
@@ -637,11 +607,6 @@
}
}
},
- "bytebuffer": {
- "version": "5.0.1",
- "from": "bytebuffer@>=5.0.0 <6.0.0",
- "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz"
- },
"bytes": {
"version": "3.1.0",
"from": "bytes@3.1.0",
@@ -663,9 +628,9 @@
"resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz"
},
"camelcase": {
- "version": "2.1.1",
- "from": "camelcase@>=2.0.1 <3.0.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz"
+ "version": "1.2.1",
+ "from": "camelcase@>=1.0.2 <2.0.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz"
},
"caseless": {
"version": "0.12.0",
@@ -721,11 +686,6 @@
}
}
},
- "chownr": {
- "version": "1.1.4",
- "from": "chownr@>=1.1.4 <2.0.0",
- "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz"
- },
"class-utils": {
"version": "0.3.6",
"from": "class-utils@>=0.3.5 <0.4.0",
@@ -771,14 +731,14 @@
}
},
"cliui": {
- "version": "3.2.0",
- "from": "cliui@>=3.0.3 <4.0.0",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
+ "version": "2.1.0",
+ "from": "cliui@>=2.1.0 <3.0.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
"dependencies": {
- "strip-ansi": {
- "version": "3.0.1",
- "from": "strip-ansi@>=3.0.1 <4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz"
+ "wordwrap": {
+ "version": "0.0.2",
+ "from": "wordwrap@0.0.2",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
@@ -832,11 +792,6 @@
"from": "colors@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz"
},
- "colour": {
- "version": "0.7.1",
- "from": "colour@>=0.7.1 <0.8.0",
- "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz"
- },
"combined-stream": {
"version": "1.0.8",
"from": "combined-stream@>=1.0.5 <1.1.0",
@@ -914,11 +869,6 @@
}
}
},
- "console-control-strings": {
- "version": "1.1.0",
- "from": "console-control-strings@>=1.1.0 <1.2.0",
- "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz"
- },
"constantinople": {
"version": "3.1.2",
"from": "constantinople@>=3.1.2 <4.0.0",
@@ -1091,7 +1041,29 @@
"data-urls": {
"version": "1.1.0",
"from": "data-urls@>=1.0.1 <2.0.0",
- "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz"
+ "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz",
+ "dependencies": {
+ "punycode": {
+ "version": "2.1.1",
+ "from": "punycode@>=2.1.0 <3.0.0",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
+ },
+ "tr46": {
+ "version": "1.0.1",
+ "from": "tr46@>=1.0.1 <2.0.0",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz"
+ },
+ "webidl-conversions": {
+ "version": "4.0.2",
+ "from": "webidl-conversions@>=4.0.2 <5.0.0",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz"
+ },
+ "whatwg-url": {
+ "version": "7.1.0",
+ "from": "whatwg-url@>=7.0.0 <8.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz"
+ }
+ }
},
"datauri": {
"version": "2.0.0",
@@ -1110,7 +1082,7 @@
},
"decamelize": {
"version": "1.2.0",
- "from": "decamelize@>=1.1.1 <2.0.0",
+ "from": "decamelize@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz"
},
"decode-uri-component": {
@@ -1182,11 +1154,6 @@
"from": "delayed-stream@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
},
- "delegates": {
- "version": "1.0.0",
- "from": "delegates@>=1.0.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
- },
"denque": {
"version": "1.5.1",
"from": "denque@>=1.1.0 <2.0.0",
@@ -1219,11 +1186,6 @@
"from": "destroy@>=1.0.4 <1.1.0",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz"
},
- "detect-libc": {
- "version": "1.0.3",
- "from": "detect-libc@>=1.0.2 <2.0.0",
- "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz"
- },
"dfa": {
"version": "1.2.0",
"from": "dfa@>=1.2.0 <2.0.0",
@@ -1281,7 +1243,14 @@
"domexception": {
"version": "1.0.1",
"from": "domexception@>=1.0.1 <2.0.0",
- "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz"
+ "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz",
+ "dependencies": {
+ "webidl-conversions": {
+ "version": "4.0.2",
+ "from": "webidl-conversions@>=4.0.2 <5.0.0",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz"
+ }
+ }
},
"domhandler": {
"version": "2.4.2",
@@ -1309,6 +1278,11 @@
"resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz",
"optional": true
},
+ "duplexify": {
+ "version": "3.6.0",
+ "from": "duplexify@3.6.0",
+ "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz"
+ },
"ecc-jsbn": {
"version": "0.1.2",
"from": "ecc-jsbn@>=0.1.1 <0.2.0",
@@ -1676,9 +1650,9 @@
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz"
},
"fast-text-encoding": {
- "version": "1.0.0",
- "from": "fast-text-encoding@1.0.0",
- "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz"
+ "version": "1.0.3",
+ "from": "fast-text-encoding@>=1.0.0 <2.0.0",
+ "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz"
},
"faye": {
"version": "1.4.0",
@@ -1794,11 +1768,6 @@
"from": "fs-extra@8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz"
},
- "fs-minipass": {
- "version": "1.2.7",
- "from": "fs-minipass@>=1.2.7 <2.0.0",
- "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz"
- },
"fs.realpath": {
"version": "1.0.0",
"from": "fs.realpath@>=1.0.0 <2.0.0",
@@ -1819,18 +1788,6 @@
"from": "functions-have-names@>=1.2.2 <2.0.0",
"resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz"
},
- "gauge": {
- "version": "2.7.4",
- "from": "gauge@>=2.7.3 <2.8.0",
- "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
- "dependencies": {
- "strip-ansi": {
- "version": "3.0.1",
- "from": "strip-ansi@>=3.0.1 <4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz"
- }
- }
- },
"gaxios": {
"version": "1.8.4",
"from": "gaxios@>=1.0.4 <2.0.0",
@@ -1840,21 +1797,6 @@
"version": "2.6.7",
"from": "node-fetch@>=2.3.0 <3.0.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz"
- },
- "tr46": {
- "version": "0.0.3",
- "from": "tr46@>=0.0.3 <0.1.0",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz"
- },
- "webidl-conversions": {
- "version": "3.0.1",
- "from": "webidl-conversions@>=3.0.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz"
- },
- "whatwg-url": {
- "version": "5.0.0",
- "from": "whatwg-url@>=5.0.0 <6.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz"
}
}
},
@@ -1914,14 +1856,7 @@
"google-p12-pem": {
"version": "1.0.5",
"from": "google-p12-pem@>=1.0.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.5.tgz",
- "dependencies": {
- "pify": {
- "version": "4.0.1",
- "from": "pify@^4.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz"
- }
- }
+ "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.5.tgz"
},
"google-tts-api": {
"version": "0.0.3",
@@ -1933,25 +1868,15 @@
"from": "graceful-fs@>=4.1.0 <5.0.0",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz"
},
- "grpc": {
- "version": "1.24.6",
- "from": "grpc@1.24.6",
- "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.24.6.tgz"
- },
"gtoken": {
- "version": "2.3.2",
- "from": "gtoken@2.3.2",
- "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.2.tgz",
+ "version": "2.3.3",
+ "from": "gtoken@>=2.3.2 <3.0.0",
+ "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.3.tgz",
"dependencies": {
"mime": {
"version": "2.6.0",
"from": "mime@>=2.2.0 <3.0.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz"
- },
- "pify": {
- "version": "4.0.1",
- "from": "pify@>=4.0.0 <5.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz"
}
}
},
@@ -2022,11 +1947,6 @@
"from": "has-tostringtag@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz"
},
- "has-unicode": {
- "version": "2.0.1",
- "from": "has-unicode@>=2.0.0 <3.0.0",
- "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz"
- },
"has-value": {
"version": "1.0.0",
"from": "has-value@>=1.0.0 <2.0.0",
@@ -2119,9 +2039,9 @@
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz"
},
"https-proxy-agent": {
- "version": "2.2.1",
- "from": "https-proxy-agent@2.2.1",
- "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz",
+ "version": "2.2.4",
+ "from": "https-proxy-agent@>=2.2.1 <3.0.0",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz",
"dependencies": {
"debug": {
"version": "3.2.7",
@@ -2150,11 +2070,6 @@
"from": "ieee754@>=1.1.13 <2.0.0",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz"
},
- "ignore-walk": {
- "version": "3.0.4",
- "from": "ignore-walk@>=3.0.1 <4.0.0",
- "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz"
- },
"image-size": {
"version": "0.7.5",
"from": "image-size@>=0.7.3 <0.8.0",
@@ -2202,11 +2117,6 @@
"from": "inherits@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz"
},
- "ini": {
- "version": "1.3.8",
- "from": "ini@>=1.3.0 <1.4.0",
- "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz"
- },
"internal-slot": {
"version": "1.0.3",
"from": "internal-slot@>=1.0.3 <2.0.0",
@@ -2408,6 +2318,11 @@
"from": "is-stream@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz"
},
+ "is-stream-ended": {
+ "version": "0.1.4",
+ "from": "is-stream-ended@0.1.4",
+ "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz"
+ },
"is-string": {
"version": "1.0.7",
"from": "is-string@>=1.0.5 <2.0.0",
@@ -2587,6 +2502,21 @@
"from": "tough-cookie@>=2.4.3 <3.0.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz"
},
+ "tr46": {
+ "version": "1.0.1",
+ "from": "tr46@>=1.0.1 <2.0.0",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz"
+ },
+ "webidl-conversions": {
+ "version": "4.0.2",
+ "from": "webidl-conversions@>=4.0.2 <5.0.0",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz"
+ },
+ "whatwg-url": {
+ "version": "7.1.0",
+ "from": "whatwg-url@>=7.0.0 <8.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz"
+ },
"ws": {
"version": "6.2.2",
"from": "ws@>=6.0.0 <7.0.0",
@@ -2699,19 +2629,7 @@
"kue": {
"version": "0.11.6",
"from": "kue@0.11.6",
- "resolved": "https://registry.npmjs.org/kue/-/kue-0.11.6.tgz",
- "dependencies": {
- "window-size": {
- "version": "0.2.0",
- "from": "window-size@>=0.2.0 <0.3.0",
- "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz"
- },
- "yargs": {
- "version": "4.8.1",
- "from": "yargs@>=4.0.0 <5.0.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz"
- }
- }
+ "resolved": "https://registry.npmjs.org/kue/-/kue-0.11.6.tgz"
},
"lazy": {
"version": "1.0.11",
@@ -2790,7 +2708,14 @@
"load-json-file": {
"version": "1.1.0",
"from": "load-json-file@>=1.0.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz"
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
+ "dependencies": {
+ "pify": {
+ "version": "2.3.0",
+ "from": "pify@>=2.0.0 <3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
+ }
+ }
},
"locate-path": {
"version": "5.0.0",
@@ -2812,6 +2737,11 @@
"from": "lodash.assignin@>=4.0.9 <5.0.0",
"resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz"
},
+ "lodash.at": {
+ "version": "4.6.0",
+ "from": "lodash.at@4.6.0",
+ "resolved": "https://registry.npmjs.org/lodash.at/-/lodash.at-4.6.0.tgz"
+ },
"lodash.bind": {
"version": "4.2.1",
"from": "lodash.bind@>=4.1.4 <5.0.0",
@@ -2819,12 +2749,12 @@
},
"lodash.camelcase": {
"version": "4.3.0",
- "from": "lodash.camelcase@>=4.3.0 <5.0.0",
+ "from": "lodash.camelcase@4.3.0",
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz"
},
"lodash.clone": {
"version": "4.5.0",
- "from": "lodash.clone@>=4.5.0 <5.0.0",
+ "from": "lodash.clone@4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz"
},
"lodash.defaults": {
@@ -2857,6 +2787,11 @@
"from": "lodash.get@>=4.4.2 <4.5.0",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz"
},
+ "lodash.has": {
+ "version": "4.5.2",
+ "from": "lodash.has@4.5.2",
+ "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz"
+ },
"lodash.includes": {
"version": "4.3.0",
"from": "lodash.includes@>=4.3.0 <5.0.0",
@@ -2942,11 +2877,6 @@
"from": "lodash.unescape@>=4.0.1 <5.0.0",
"resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz"
},
- "long": {
- "version": "3.2.0",
- "from": "long@>=3.0.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz"
- },
"longest": {
"version": "1.0.1",
"from": "longest@>=1.0.1 <2.0.0",
@@ -3093,16 +3023,6 @@
"from": "minimist@>=1.2.6 <2.0.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz"
},
- "minipass": {
- "version": "2.9.0",
- "from": "minipass@>=2.9.0 <3.0.0",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz"
- },
- "minizlib": {
- "version": "1.3.3",
- "from": "minizlib@>=1.3.3 <2.0.0",
- "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz"
- },
"mixin-deep": {
"version": "1.3.2",
"from": "mixin-deep@>=1.2.0 <2.0.0",
@@ -3194,7 +3114,7 @@
},
"nan": {
"version": "2.16.0",
- "from": "nan@>=2.13.2 <3.0.0",
+ "from": "nan@>=2.14.0 <3.0.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz"
},
"nanomatch": {
@@ -3223,7 +3143,7 @@
},
"needle": {
"version": "2.9.1",
- "from": "needle@>=2.5.0 <3.0.0",
+ "from": "needle@>=2.1.0 <3.0.0",
"resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz",
"dependencies": {
"debug": {
@@ -3295,11 +3215,6 @@
"from": "node-forge@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz"
},
- "node-pre-gyp": {
- "version": "0.16.0",
- "from": "node-pre-gyp@>=0.16.0 <0.17.0",
- "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.16.0.tgz"
- },
"node-redis-scripty": {
"version": "0.0.5",
"from": "node-redis-scripty@0.0.5",
@@ -3436,11 +3351,6 @@
"from": "nodemailer-plugin-inline-base64@2.1.1",
"resolved": "https://registry.npmjs.org/nodemailer-plugin-inline-base64/-/nodemailer-plugin-inline-base64-2.1.1.tgz"
},
- "nopt": {
- "version": "4.0.3",
- "from": "nopt@>=4.0.1 <5.0.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz"
- },
"normalize-package-data": {
"version": "2.5.0",
"from": "normalize-package-data@>=2.3.2 <3.0.0",
@@ -3456,26 +3366,6 @@
"from": "notepack.io@>=2.1.0 <2.2.0",
"resolved": "https://registry.npmjs.org/notepack.io/-/notepack.io-2.1.3.tgz"
},
- "npm-bundled": {
- "version": "1.1.2",
- "from": "npm-bundled@>=1.0.1 <2.0.0",
- "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz"
- },
- "npm-normalize-package-bin": {
- "version": "1.0.1",
- "from": "npm-normalize-package-bin@>=1.0.1 <2.0.0",
- "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz"
- },
- "npm-packlist": {
- "version": "1.4.8",
- "from": "npm-packlist@>=1.1.6 <2.0.0",
- "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz"
- },
- "npmlog": {
- "version": "4.1.2",
- "from": "npmlog@>=4.0.2 <5.0.0",
- "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz"
- },
"nssocket": {
"version": "0.6.0",
"from": "nssocket@0.6.0",
@@ -3607,31 +3497,11 @@
"from": "optionator@>=0.8.1 <0.9.0",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz"
},
- "optjs": {
- "version": "3.2.2",
- "from": "optjs@>=3.2.2 <3.3.0",
- "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz"
- },
- "os-homedir": {
- "version": "1.0.2",
- "from": "os-homedir@>=1.0.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz"
- },
"os-locale": {
"version": "1.4.0",
"from": "os-locale@>=1.4.0 <2.0.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz"
},
- "os-tmpdir": {
- "version": "1.0.2",
- "from": "os-tmpdir@>=1.0.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz"
- },
- "osenv": {
- "version": "0.1.5",
- "from": "osenv@>=0.1.4 <0.2.0",
- "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz"
- },
"p-limit": {
"version": "2.3.0",
"from": "p-limit@>=2.2.0 <3.0.0",
@@ -3745,7 +3615,14 @@
"path-type": {
"version": "1.1.0",
"from": "path-type@>=1.0.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz"
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
+ "dependencies": {
+ "pify": {
+ "version": "2.3.0",
+ "from": "pify@>=2.0.0 <3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
+ }
+ }
},
"pause": {
"version": "0.0.1",
@@ -3785,9 +3662,9 @@
"resolved": "https://registry.npmjs.org/pidusage/-/pidusage-1.2.0.tgz"
},
"pify": {
- "version": "2.3.0",
- "from": "pify@>=2.0.0 <3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
+ "version": "4.0.1",
+ "from": "pify@>=4.0.0 <5.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz"
},
"pinkie": {
"version": "2.0.4",
@@ -3979,11 +3856,6 @@
"from": "promptly@2.2.0",
"resolved": "https://registry.npmjs.org/promptly/-/promptly-2.2.0.tgz"
},
- "protobufjs": {
- "version": "5.0.3",
- "from": "protobufjs@>=5.0.3 <6.0.0",
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz"
- },
"proxy-addr": {
"version": "2.0.7",
"from": "proxy-addr@>=2.0.5 <2.1.0",
@@ -4094,11 +3966,6 @@
"from": "raw-body@2.4.0",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz"
},
- "rc": {
- "version": "1.2.8",
- "from": "rc@>=1.2.7 <2.0.0",
- "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz"
- },
"read": {
"version": "1.0.7",
"from": "read@>=1.0.4 <2.0.0",
@@ -4267,6 +4134,11 @@
"from": "retry-as-promised@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-2.3.2.tgz"
},
+ "retry-request": {
+ "version": "4.0.0",
+ "from": "retry-request@4.0.0",
+ "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.0.0.tgz"
+ },
"right-align": {
"version": "0.1.3",
"from": "right-align@>=0.1.1 <0.2.0",
@@ -4381,7 +4253,7 @@
},
"set-blocking": {
"version": "2.0.0",
- "from": "set-blocking@>=2.0.0 <2.1.0",
+ "from": "set-blocking@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz"
},
"set-value": {
@@ -4426,11 +4298,6 @@
"from": "side-channel@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz"
},
- "signal-exit": {
- "version": "3.0.7",
- "from": "signal-exit@>=3.0.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz"
- },
"simple-git": {
"version": "1.132.0",
"from": "simple-git@1.132.0",
@@ -4780,6 +4647,11 @@
"from": "sticky-session@1.1.2",
"resolved": "https://registry.npmjs.org/sticky-session/-/sticky-session-1.1.2.tgz"
},
+ "stream-shift": {
+ "version": "1.0.1",
+ "from": "stream-shift@>=1.0.0 <2.0.0",
+ "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz"
+ },
"streamsearch": {
"version": "0.1.2",
"from": "streamsearch@0.1.2",
@@ -4827,11 +4699,6 @@
"from": "strip-bom@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz"
},
- "strip-json-comments": {
- "version": "2.0.1",
- "from": "strip-json-comments@>=2.0.1 <2.1.0",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz"
- },
"stylus": {
"version": "0.54.8",
"from": "stylus@>=0.54.5 <0.55.0",
@@ -4904,18 +4771,6 @@
"from": "systeminformation@3.54.0",
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-3.54.0.tgz"
},
- "tar": {
- "version": "4.4.19",
- "from": "tar@>=4.4.2 <5.0.0",
- "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz",
- "dependencies": {
- "safe-buffer": {
- "version": "5.2.1",
- "from": "safe-buffer@>=5.2.1 <6.0.0",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz"
- }
- }
- },
"tar-stream": {
"version": "1.6.2",
"from": "tar-stream@>=1.5.0 <2.0.0",
@@ -4936,6 +4791,11 @@
"from": "through@>=2.2.7 <3.0.0",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz"
},
+ "through2": {
+ "version": "2.0.5",
+ "from": "through2@>=2.0.0 <3.0.0",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz"
+ },
"tiff2pdf": {
"version": "1.0.2",
"from": "tiff2pdf@1.0.2",
@@ -5026,16 +4886,9 @@
}
},
"tr46": {
- "version": "1.0.1",
- "from": "tr46@>=1.0.1 <2.0.0",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
- "dependencies": {
- "punycode": {
- "version": "2.1.1",
- "from": "punycode@>=2.1.0 <3.0.0",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
- }
- }
+ "version": "0.0.3",
+ "from": "tr46@>=0.0.3 <0.1.0",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz"
},
"tslib": {
"version": "2.4.0",
@@ -5119,31 +4972,11 @@
"from": "uglify-js@>=2.6.1 <3.0.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",
"dependencies": {
- "camelcase": {
- "version": "1.2.1",
- "from": "camelcase@>=1.0.2 <2.0.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz"
- },
- "cliui": {
- "version": "2.1.0",
- "from": "cliui@>=2.1.0 <3.0.0",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz"
- },
"source-map": {
"version": "0.5.7",
"from": "source-map@>=0.5.1 <0.6.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz"
},
- "window-size": {
- "version": "0.1.0",
- "from": "window-size@0.1.0",
- "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz"
- },
- "wordwrap": {
- "version": "0.0.2",
- "from": "wordwrap@0.0.2",
- "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
- },
"yargs": {
"version": "3.10.0",
"from": "yargs@>=3.10.0 <3.11.0",
@@ -5487,9 +5320,9 @@
}
},
"webidl-conversions": {
- "version": "4.0.2",
- "from": "webidl-conversions@>=4.0.2 <5.0.0",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz"
+ "version": "3.0.1",
+ "from": "webidl-conversions@>=3.0.0 <4.0.0",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz"
},
"websocket-driver": {
"version": "0.7.4",
@@ -5517,9 +5350,9 @@
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz"
},
"whatwg-url": {
- "version": "7.1.0",
- "from": "whatwg-url@>=7.0.0 <8.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz"
+ "version": "5.0.0",
+ "from": "whatwg-url@>=5.0.0 <6.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz"
},
"which": {
"version": "1.3.1",
@@ -5546,15 +5379,10 @@
"from": "which-typed-array@>=1.1.2 <2.0.0",
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz"
},
- "wide-align": {
- "version": "1.1.5",
- "from": "wide-align@>=1.1.0 <2.0.0",
- "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz"
- },
"window-size": {
- "version": "0.1.4",
- "from": "window-size@>=0.1.4 <0.2.0",
- "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz"
+ "version": "0.1.0",
+ "from": "window-size@0.1.0",
+ "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz"
},
"winston": {
"version": "2.4.5",
@@ -5702,23 +5530,35 @@
},
"y18n": {
"version": "3.2.2",
- "from": "y18n@>=3.2.0 <4.0.0",
+ "from": "y18n@>=3.2.1 <4.0.0",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz"
},
- "yallist": {
- "version": "3.1.1",
- "from": "yallist@>=3.1.1 <4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz"
- },
"yamljs": {
"version": "0.3.0",
"from": "yamljs@>=0.3.0 <0.4.0",
"resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz"
},
"yargs": {
- "version": "3.32.0",
- "from": "yargs@>=3.10.0 <4.0.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz"
+ "version": "4.8.1",
+ "from": "yargs@>=4.0.0 <5.0.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz",
+ "dependencies": {
+ "cliui": {
+ "version": "3.2.0",
+ "from": "cliui@>=3.2.0 <4.0.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz"
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "from": "strip-ansi@>=3.0.1 <4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz"
+ },
+ "window-size": {
+ "version": "0.2.0",
+ "from": "window-size@>=0.2.0 <0.3.0",
+ "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz"
+ }
+ }
},
"yargs-parser": {
"version": "2.4.1",
diff --git a/package.json b/package.json
index 55df9e2..2465c10 100644
--- a/package.json
+++ b/package.json
@@ -67,6 +67,7 @@
"cron-job-manager": "1.0.7",
"crypto-js": "3.1.9-1",
"desk.js": "0.1.4",
+ "duplexify": "^3.6.0",
"ejs": "2.7.4",
"eml-format": "0.5.0",
"entities": "1.1.2",
@@ -79,7 +80,6 @@
"fast-text-encoding": "^1.0.0",
"fs-extra": "8.1.0",
"google-tts-api": "git+https://github.com/xmdevelop/google-tts.git",
- "grpc": "1.24.6",
"gtoken": "^2.3.2",
"html-entities": "2.3.2",
"html-to-pdfmake": "2.1.7",
@@ -89,6 +89,7 @@
"imap": "0.8.19",
"ioredis": "4.17.3",
"ipaddr.js": "1.9.1",
+ "is-stream-ended": "^0.1.4",
"jayson": "2.1.2",
"jsdom": "12.0.0",
"jsforce": "1.9.3",
@@ -98,6 +99,10 @@
"juice": "6.0.0",
"kue": "0.11.6",
"lodash": "4.17.20",
+ "lodash.at": "^4.6.0",
+ "lodash.camelcase": "^4.3.0",
+ "lodash.clone": "^4.5.0",
+ "lodash.has": "^4.5.2",
"lusca": "1.6.1",
"mailparser": "2.7.5",
"md5": "2.3.0",
@@ -121,6 +126,7 @@
"pm2": "2.10.4",
"randomstring": "1.1.5",
"request-promise": "4.2.6",
+ "retry-request": "^4.0.0",
"rimraf": "2.7.1",
"rr": "0.1.0",
"seq-queue": "0.0.5",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 502b63c..51f357d 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 _0x2c75=['browser','script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','action','STRING','integration','motionbar','jscripty','urlForward'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x2c75,0x127));var _0x52c7=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x2c75[_0xfc406a];return _0x395473;};'use strict';var Sequelize=require(_0x52c7('0x0'));module[_0x52c7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xa17760){return this[_0x52c7('0x2')](_0x52c7('0x3'));}},'action':{'type':Sequelize[_0x52c7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x52c7('0x5'),_0x52c7('0x6'),_0x52c7('0x7'),_0x52c7('0x8'),_0x52c7('0x9'),'bot',_0x52c7('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x52c7('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x52c7('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x52c7('0xb')},'data4':{'type':Sequelize[_0x52c7('0x4')](0x1000),'comments':_0x52c7('0xc')},'data5':{'type':Sequelize[_0x52c7('0x4')](0x1000),'comments':_0x52c7('0xd')},'data6':{'type':Sequelize[_0x52c7('0x4')],'comments':_0x52c7('0xe')},'data7':{'type':Sequelize[_0x52c7('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x6722=['contactManager','integration','motionbar','jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0xb38b0,_0x312844){var _0x1f6b89=function(_0x34ccf1){while(--_0x34ccf1){_0xb38b0['push'](_0xb38b0['shift']());}};_0x1f6b89(++_0x312844);}(_0x6722,0x12d));var _0x2672=function(_0x47e80f,_0x38f1f6){_0x47e80f=_0x47e80f-0x0;var _0x4a7fe2=_0x6722[_0x47e80f];return _0x4a7fe2;};'use strict';var Sequelize=require(_0x2672('0x0'));module[_0x2672('0x1')]={'name':{'type':Sequelize[_0x2672('0x2')],'get':function(_0x372687){return this[_0x2672('0x3')]('action');}},'action':{'type':Sequelize[_0x2672('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2672('0x5'),_0x2672('0x6'),_0x2672('0x7'),_0x2672('0x8'),'urlForward',_0x2672('0x9'),_0x2672('0xa'),'script']],'msg':_0x2672('0xb')}},'comment':_0x2672('0xb')},'data1':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xc')},'data2':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xd')},'data3':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xe')},'data4':{'type':Sequelize[_0x2672('0x4')](0x1000),'comments':_0x2672('0xf')},'data5':{'type':Sequelize[_0x2672('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x2672('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x2672('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 3da5555..cc9e7f8 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 _0x4ee1=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','body','destroy','catch'];(function(_0x40af8d,_0x4ba09d){var _0x39d1a9=function(_0x322d56){while(--_0x322d56){_0x40af8d['push'](_0x40af8d['shift']());}};_0x39d1a9(++_0x4ba09d);}(_0x4ee1,0x1ae));var _0x14ee=function(_0x4946b9,_0x4ca322){_0x4946b9=_0x4946b9-0x0;var _0x9cce5e=_0x4ee1[_0x4946b9];return _0x9cce5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14ee('0x0'));var zipdir=require(_0x14ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14ee('0x2'));var moment=require(_0x14ee('0x3'));var BPromise=require(_0x14ee('0x4'));var Mustache=require(_0x14ee('0x5'));var util=require(_0x14ee('0x6'));var path=require(_0x14ee('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x14ee('0x8'));var fs=require('fs');var fs_extra=require(_0x14ee('0x9'));var _=require(_0x14ee('0xa'));var squel=require(_0x14ee('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x14ee('0xc'));var toCsv=require(_0x14ee('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x14ee('0xe'));var hardwareService=require(_0x14ee('0xf'));var logger=require(_0x14ee('0x10'))(_0x14ee('0x11'));var utils=require(_0x14ee('0x12'));var config=require(_0x14ee('0x13'));var licenseUtil=require(_0x14ee('0x14'));var db=require(_0x14ee('0x15'))['db'];function respondWithStatusCode(_0x1683af,_0x20564c){_0x20564c=_0x20564c||0xcc;return function(_0x5a68da){if(_0x5a68da){return _0x1683af[_0x14ee('0x16')](_0x20564c);}return _0x1683af[_0x14ee('0x17')](_0x20564c)[_0x14ee('0x18')]();};}function respondWithResult(_0x2d1e52,_0x5d1521){_0x5d1521=_0x5d1521||0xc8;return function(_0x47a755){if(_0x47a755){return _0x2d1e52['status'](_0x5d1521)[_0x14ee('0x19')](_0x47a755);}};}function respondWithFilteredResult(_0x4882c8,_0x40ab08){return function(_0x4cbe4f){if(_0x4cbe4f){var _0x37361b=typeof _0x40ab08['offset']===_0x14ee('0x1a')&&typeof _0x40ab08[_0x14ee('0x1b')]===_0x14ee('0x1a');var _0x184607=_0x4cbe4f[_0x14ee('0x1c')];var _0x3fa71c=_0x37361b?0x0:_0x40ab08[_0x14ee('0x1d')];var _0x2b5983=_0x37361b?_0x4cbe4f[_0x14ee('0x1c')]:_0x40ab08[_0x14ee('0x1d')]+_0x40ab08[_0x14ee('0x1b')];var _0x4758a5;if(_0x2b5983>=_0x184607){_0x2b5983=_0x184607;_0x4758a5=0xc8;}else{_0x4758a5=0xce;}_0x4882c8[_0x14ee('0x17')](_0x4758a5);return _0x4882c8[_0x14ee('0x1e')](_0x14ee('0x1f'),_0x3fa71c+'-'+_0x2b5983+'/'+_0x184607)[_0x14ee('0x19')](_0x4cbe4f);}return null;};}function patchUpdates(_0x530acb){return function(_0x38bc16){try{jsonpatch[_0x14ee('0x20')](_0x38bc16,_0x530acb,!![]);}catch(_0x34d3f7){return BPromise[_0x14ee('0x21')](_0x34d3f7);}return _0x38bc16[_0x14ee('0x22')]();};}function saveUpdates(_0x2afc82,_0x29a392){return function(_0x46bdac){if(_0x46bdac){return _0x46bdac[_0x14ee('0x23')](_0x2afc82)['then'](function(_0x4379be){return _0x4379be;});}return null;};}function removeEntity(_0x116c45,_0x154b45){return function(_0x52315d){if(_0x52315d){return _0x52315d['destroy']()[_0x14ee('0x24')](function(){_0x116c45[_0x14ee('0x17')](0xcc)[_0x14ee('0x18')]();});}};}function handleEntityNotFound(_0x5b5fd2,_0x2083f3){return function(_0x4fd41b){if(!_0x4fd41b){_0x5b5fd2[_0x14ee('0x16')](0x194);}return _0x4fd41b;};}function handleError(_0x397d88,_0x283711){_0x283711=_0x283711||0x1f4;return function(_0x4c3c2d){logger[_0x14ee('0x25')](_0x4c3c2d['stack']);if(_0x4c3c2d[_0x14ee('0x26')]){delete _0x4c3c2d['name'];}_0x397d88[_0x14ee('0x17')](_0x283711)[_0x14ee('0x27')](_0x4c3c2d);};}exports['update']=function(_0x108bac,_0x455744){if(_0x108bac[_0x14ee('0x28')]['id']){delete _0x108bac[_0x14ee('0x28')]['id'];}return db['Action']['find']({'where':{'id':_0x108bac['params']['id']}})['then'](handleEntityNotFound(_0x455744,null))[_0x14ee('0x24')](saveUpdates(_0x108bac[_0x14ee('0x28')],null))[_0x14ee('0x24')](respondWithResult(_0x455744,null))['catch'](handleError(_0x455744,null));};exports[_0x14ee('0x29')]=function(_0x4a2590,_0x54cd6b){return db['Action']['find']({'where':{'id':_0x4a2590['params']['id']}})[_0x14ee('0x24')](handleEntityNotFound(_0x54cd6b,null))[_0x14ee('0x24')](removeEntity(_0x54cd6b,null))[_0x14ee('0x2a')](handleError(_0x54cd6b,null));};
\ No newline at end of file
+var _0xc65c=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','destroy','error','stack','name','send','body','Action','find','params','then','catch','eml-format','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x424a50,_0x1fd66d){var _0x1427b2=function(_0x35f2a0){while(--_0x35f2a0){_0x424a50['push'](_0x424a50['shift']());}};_0x1427b2(++_0x1fd66d);}(_0xc65c,0x124));var _0xcc65=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xc65c[_0x4ea413];return _0x51cf25;};'use strict';var emlformat=require(_0xcc65('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcc65('0x1'));var moment=require(_0xcc65('0x2'));var BPromise=require(_0xcc65('0x3'));var Mustache=require(_0xcc65('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcc65('0x5'));var ejs=require(_0xcc65('0x6'));var fs=require('fs');var fs_extra=require(_0xcc65('0x7'));var _=require(_0xcc65('0x8'));var squel=require(_0xcc65('0x9'));var crypto=require(_0xcc65('0xa'));var jsforce=require(_0xcc65('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcc65('0x5'));var querystring=require(_0xcc65('0xc'));var Papa=require(_0xcc65('0xd'));var Redis=require(_0xcc65('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcc65('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc65('0x10'));var logger=require(_0xcc65('0x11'))('api');var utils=require(_0xcc65('0x12'));var config=require(_0xcc65('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc65('0x14'))['db'];function respondWithStatusCode(_0x1fb428,_0xf105aa){_0xf105aa=_0xf105aa||0xcc;return function(_0x1a4aee){if(_0x1a4aee){return _0x1fb428[_0xcc65('0x15')](_0xf105aa);}return _0x1fb428[_0xcc65('0x16')](_0xf105aa)[_0xcc65('0x17')]();};}function respondWithResult(_0x212a2d,_0x3bfd84){_0x3bfd84=_0x3bfd84||0xc8;return function(_0x37c403){if(_0x37c403){return _0x212a2d[_0xcc65('0x16')](_0x3bfd84)['json'](_0x37c403);}};}function respondWithFilteredResult(_0xbc44cf,_0x1d0612){return function(_0x56bb39){if(_0x56bb39){var _0x2ce91e=typeof _0x1d0612[_0xcc65('0x18')]===_0xcc65('0x19')&&typeof _0x1d0612['limit']===_0xcc65('0x19');var _0xe676f7=_0x56bb39[_0xcc65('0x1a')];var _0x16bb3f=_0x2ce91e?0x0:_0x1d0612['offset'];var _0x541eef=_0x2ce91e?_0x56bb39['count']:_0x1d0612['offset']+_0x1d0612[_0xcc65('0x1b')];var _0x104fd8;if(_0x541eef>=_0xe676f7){_0x541eef=_0xe676f7;_0x104fd8=0xc8;}else{_0x104fd8=0xce;}_0xbc44cf[_0xcc65('0x16')](_0x104fd8);return _0xbc44cf[_0xcc65('0x1c')]('Content-Range',_0x16bb3f+'-'+_0x541eef+'/'+_0xe676f7)[_0xcc65('0x1d')](_0x56bb39);}return null;};}function patchUpdates(_0xac8918){return function(_0x456dbe){try{jsonpatch['apply'](_0x456dbe,_0xac8918,!![]);}catch(_0x4ee09c){return BPromise[_0xcc65('0x1e')](_0x4ee09c);}return _0x456dbe[_0xcc65('0x1f')]();};}function saveUpdates(_0x6b36b7,_0x296e71){return function(_0x4c99da){if(_0x4c99da){return _0x4c99da[_0xcc65('0x20')](_0x6b36b7)['then'](function(_0x347d87){return _0x347d87;});}return null;};}function removeEntity(_0x5168d8,_0x37ea5f){return function(_0x5dfd4e){if(_0x5dfd4e){return _0x5dfd4e[_0xcc65('0x21')]()['then'](function(){_0x5168d8[_0xcc65('0x16')](0xcc)[_0xcc65('0x17')]();});}};}function handleEntityNotFound(_0x2d9374,_0x190137){return function(_0x2afc46){if(!_0x2afc46){_0x2d9374[_0xcc65('0x15')](0x194);}return _0x2afc46;};}function handleError(_0x39d57d,_0x1d9b11){_0x1d9b11=_0x1d9b11||0x1f4;return function(_0x2949ec){logger[_0xcc65('0x22')](_0x2949ec[_0xcc65('0x23')]);if(_0x2949ec[_0xcc65('0x24')]){delete _0x2949ec['name'];}_0x39d57d[_0xcc65('0x16')](_0x1d9b11)[_0xcc65('0x25')](_0x2949ec);};}exports[_0xcc65('0x20')]=function(_0x411823,_0x45f444){if(_0x411823[_0xcc65('0x26')]['id']){delete _0x411823[_0xcc65('0x26')]['id'];}return db[_0xcc65('0x27')][_0xcc65('0x28')]({'where':{'id':_0x411823[_0xcc65('0x29')]['id']}})[_0xcc65('0x2a')](handleEntityNotFound(_0x45f444,null))[_0xcc65('0x2a')](saveUpdates(_0x411823[_0xcc65('0x26')],null))[_0xcc65('0x2a')](respondWithResult(_0x45f444,null))[_0xcc65('0x2b')](handleError(_0x45f444,null));};exports[_0xcc65('0x21')]=function(_0x366c27,_0x63510){return db[_0xcc65('0x27')][_0xcc65('0x28')]({'where':{'id':_0x366c27[_0xcc65('0x29')]['id']}})['then'](handleEntityNotFound(_0x63510,null))[_0xcc65('0x2a')](removeEntity(_0x63510,null))[_0xcc65('0x2b')](handleError(_0x63510,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index fb43fe0..3a0cdf4 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 _0x1113=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','api','request-promise','path'];(function(_0x113f61,_0x2d3081){var _0x1e8cf6=function(_0x3dc374){while(--_0x3dc374){_0x113f61['push'](_0x113f61['shift']());}};_0x1e8cf6(++_0x2d3081);}(_0x1113,0x16f));var _0x3111=function(_0x5aedea,_0xf4a7f){_0x5aedea=_0x5aedea-0x0;var _0xe35173=_0x1113[_0x5aedea];return _0xe35173;};'use strict';var _=require('lodash');var util=require(_0x3111('0x0'));var logger=require(_0x3111('0x1'))(_0x3111('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3111('0x3'));var fs=require('fs');var path=require(_0x3111('0x4'));var rimraf=require(_0x3111('0x5'));var config=require(_0x3111('0x6'));var attributes=require(_0x3111('0x7'));module[_0x3111('0x8')]=function(_0x482746,_0x48ba8a){return _0x482746[_0x3111('0x9')](_0x3111('0xa'),attributes,{'tableName':_0x3111('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad58=['exports','Action','lodash','util','../../config/logger','moment','request-promise','rimraf','./action.attributes'];(function(_0x26df5a,_0xda2483){var _0x4e6eee=function(_0x488ddb){while(--_0x488ddb){_0x26df5a['push'](_0x26df5a['shift']());}};_0x4e6eee(++_0xda2483);}(_0xad58,0x1df));var _0x8ad5=function(_0x217832,_0x34fdea){_0x217832=_0x217832-0x0;var _0x5c0a8b=_0xad58[_0x217832];return _0x5c0a8b;};'use strict';var _=require(_0x8ad5('0x0'));var util=require(_0x8ad5('0x1'));var logger=require(_0x8ad5('0x2'))('api');var moment=require(_0x8ad5('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ad5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ad5('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ad5('0x6'));module[_0x8ad5('0x7')]=function(_0x288f6a,_0x46af87){return _0x288f6a['define'](_0x8ad5('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 a195ef9..21344da 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4975,0x86));var _0x5497=function(_0x2f59c9,_0x1b8c20){_0x2f59c9=_0x2f59c9-0x0;var _0x31c216=_0x4975[_0x2f59c9];return _0x31c216;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2cceac,_0x4f089c){var _0x15ed38=function(_0x326c89){while(--_0x326c89){_0x2cceac['push'](_0x2cceac['shift']());}};_0x15ed38(++_0x4f089c);}(_0xabce,0x103));var _0xeabc=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xabce[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 96bde74..2b2d842 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 _0x2218=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x2218,0x1cb));var _0x8221=function(_0x5e1e25,_0xdc1421){_0x5e1e25=_0x5e1e25-0x0;var _0x548e5f=_0x2218[_0x5e1e25];return _0x548e5f;};'use strict';var multer=require(_0x8221('0x0'));var util=require(_0x8221('0x1'));var path=require(_0x8221('0x2'));var timeout=require(_0x8221('0x3'));var express=require(_0x8221('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8221('0x5'));var interaction=require(_0x8221('0x6'));var config=require(_0x8221('0x7'));var controller=require(_0x8221('0x8'));router[_0x8221('0x9')](_0x8221('0xa'),auth[_0x8221('0xb')](),controller[_0x8221('0xc')]);router[_0x8221('0xd')](_0x8221('0xa'),auth[_0x8221('0xb')](),controller[_0x8221('0xe')]);module[_0x8221('0xf')]=router;
\ No newline at end of file
+var _0x53d9=['fs-extra','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','multer','path','express','Router'];(function(_0x77d76e,_0x106ed2){var _0x5620c8=function(_0x481b37){while(--_0x481b37){_0x77d76e['push'](_0x77d76e['shift']());}};_0x5620c8(++_0x106ed2);}(_0x53d9,0x188));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x953d('0x0'));var util=require('util');var path=require(_0x953d('0x1'));var timeout=require('connect-timeout');var express=require(_0x953d('0x2'));var router=express[_0x953d('0x3')]();var fs_extra=require(_0x953d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x953d('0x5'));var controller=require(_0x953d('0x6'));router[_0x953d('0x7')](_0x953d('0x8'),auth[_0x953d('0x9')](),controller['update']);router[_0x953d('0xa')](_0x953d('0x8'),auth['isAuthenticated'](),controller[_0x953d('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d06c46a..358e36b 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 _0xda19=['exports','STRING','TEXT'];(function(_0x72ad60,_0x2392a3){var _0x3ebc2e=function(_0x3b6905){while(--_0x3b6905){_0x72ad60['push'](_0x72ad60['shift']());}};_0x3ebc2e(++_0x2392a3);}(_0xda19,0xd5));var _0x9da1=function(_0xcc4dfc,_0x296d80){_0xcc4dfc=_0xcc4dfc-0x0;var _0x377146=_0xda19[_0xcc4dfc];return _0x377146;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x1c28a6,_0x5c2381){var _0x5d622e=function(_0x1f39a9){while(--_0x1f39a9){_0x1c28a6['push'](_0x1c28a6['shift']());}};_0x5d622e(++_0x5c2381);}(_0x5fc3,0xa8));var _0x35fc=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x5fc3[_0x211fef];return _0x5447bf;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index db34426..23997a0 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 _0x8254=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','CustomReports','UserProfileResource','destroy','error','name','send','index','AnalyticCustomReport','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','catch','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','left_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','value','parentKey','web','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','MAX(%s)','metric','%s.%s\x20=\x20%s.%s','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4b817c,_0x8099e3){var _0x5ccf31=function(_0x5c37c5){while(--_0x5c37c5){_0x4b817c['push'](_0x4b817c['shift']());}};_0x5ccf31(++_0x8099e3);}(_0x8254,0x95));var _0x4825=function(_0xb12148,_0xe8d5c1){_0xb12148=_0xb12148-0x0;var _0x4570fd=_0x8254[_0xb12148];return _0x4570fd;};'use strict';var emlformat=require(_0x4825('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4825('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4825('0x2'));var moment=require(_0x4825('0x3'));var BPromise=require(_0x4825('0x4'));var Mustache=require('mustache');var util=require(_0x4825('0x5'));var path=require(_0x4825('0x6'));var sox=require(_0x4825('0x7'));var csv=require(_0x4825('0x8'));var ejs=require(_0x4825('0x9'));var fs=require('fs');var fs_extra=require(_0x4825('0xa'));var _=require('lodash');var squel=require(_0x4825('0xb'));var crypto=require(_0x4825('0xc'));var jsforce=require(_0x4825('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4825('0x8'));var querystring=require(_0x4825('0xe'));var Papa=require(_0x4825('0xf'));var Redis=require(_0x4825('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4825('0x11'));var as=require(_0x4825('0x12'));var hardwareService=require(_0x4825('0x13'));var logger=require('../../config/logger')(_0x4825('0x14'));var utils=require(_0x4825('0x15'));var config=require(_0x4825('0x16'));var licenseUtil=require(_0x4825('0x17'));var db=require(_0x4825('0x18'))['db'];var dbH=require('../../mysqldb')[_0x4825('0x19')];function respondWithStatusCode(_0x37cb62,_0x3d544d){_0x3d544d=_0x3d544d||0xcc;return function(_0x3bc633){if(_0x3bc633){return _0x37cb62[_0x4825('0x1a')](_0x3d544d);}return _0x37cb62[_0x4825('0x1b')](_0x3d544d)[_0x4825('0x1c')]();};}function respondWithResult(_0x1c903c,_0x7ac2e2){_0x7ac2e2=_0x7ac2e2||0xc8;return function(_0x483d0e){if(_0x483d0e){return _0x1c903c[_0x4825('0x1b')](_0x7ac2e2)[_0x4825('0x1d')](_0x483d0e);}};}function respondWithFilteredResult(_0x264845,_0x29628e){return function(_0x5b63d0){if(_0x5b63d0){var _0x52101e=typeof _0x29628e['offset']===_0x4825('0x1e')&&typeof _0x29628e[_0x4825('0x1f')]===_0x4825('0x1e');var _0xfe92ce=_0x5b63d0[_0x4825('0x20')];var _0x3b3a52=_0x52101e?0x0:_0x29628e[_0x4825('0x21')];var _0x1de7ae=_0x52101e?_0x5b63d0['count']:_0x29628e[_0x4825('0x21')]+_0x29628e[_0x4825('0x1f')];var _0xdf1083;if(_0x1de7ae>=_0xfe92ce){_0x1de7ae=_0xfe92ce;_0xdf1083=0xc8;}else{_0xdf1083=0xce;}_0x264845[_0x4825('0x1b')](_0xdf1083);return _0x264845[_0x4825('0x22')](_0x4825('0x23'),_0x3b3a52+'-'+_0x1de7ae+'/'+_0xfe92ce)[_0x4825('0x1d')](_0x5b63d0);}return null;};}function patchUpdates(_0x843363){return function(_0x147b7c){try{jsonpatch[_0x4825('0x24')](_0x147b7c,_0x843363,!![]);}catch(_0x147b1a){return BPromise[_0x4825('0x25')](_0x147b1a);}return _0x147b7c['save']();};}function saveUpdates(_0x53b6cd,_0x45a011){return function(_0x3abcf6){if(_0x3abcf6){return _0x3abcf6[_0x4825('0x26')](_0x53b6cd)[_0x4825('0x27')](function(_0x13bbb6){return _0x13bbb6;});}return null;};}function removeEntity(_0x185d41,_0x2a6890){return function(_0xb9c7cc){if(_0xb9c7cc){return _0xb9c7cc['destroy']()[_0x4825('0x27')](function(){var _0x5027d6=_0xb9c7cc['get']({'plain':!![]});var _0x5585c7=_0x4825('0x28');return db[_0x4825('0x29')][_0x4825('0x2a')]({'where':{'type':_0x5585c7,'resourceId':_0x5027d6['id']}})[_0x4825('0x27')](function(){return _0xb9c7cc;});})[_0x4825('0x27')](function(){_0x185d41[_0x4825('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce5ef,_0x348cea){return function(_0x505a8e){if(!_0x505a8e){_0x5ce5ef[_0x4825('0x1a')](0x194);}return _0x505a8e;};}function handleError(_0x36b5a5,_0x5d0812){_0x5d0812=_0x5d0812||0x1f4;return function(_0x3344d8){logger[_0x4825('0x2b')](_0x3344d8['stack']);if(_0x3344d8['name']){delete _0x3344d8[_0x4825('0x2c')];}_0x36b5a5['status'](_0x5d0812)[_0x4825('0x2d')](_0x3344d8);};}exports[_0x4825('0x2e')]=function(_0x278e61,_0x805e85){var _0x3a2801={},_0x365484={},_0x4b5ba8={'count':0x0,'rows':[]};var _0x310a83=_['map'](db[_0x4825('0x2f')][_0x4825('0x30')],function(_0x22aa67){return{'name':_0x22aa67['fieldName'],'type':_0x22aa67['type']['key']};});_0x365484[_0x4825('0x31')]=_['map'](_0x310a83,'name');_0x365484[_0x4825('0x32')]=_[_0x4825('0x33')](_0x278e61[_0x4825('0x32')]);_0x365484['filters']=_[_0x4825('0x34')](_0x365484[_0x4825('0x31')],_0x365484[_0x4825('0x32')]);_0x3a2801[_0x4825('0x35')]=_[_0x4825('0x34')](_0x365484[_0x4825('0x31')],qs['fields'](_0x278e61['query'][_0x4825('0x36')]));_0x3a2801[_0x4825('0x35')]=_0x3a2801['attributes'][_0x4825('0x37')]?_0x3a2801['attributes']:_0x365484[_0x4825('0x31')];if(!_0x278e61[_0x4825('0x32')][_0x4825('0x38')]('nolimit')){_0x3a2801[_0x4825('0x1f')]=qs[_0x4825('0x1f')](_0x278e61[_0x4825('0x32')]['limit']);_0x3a2801[_0x4825('0x21')]=qs[_0x4825('0x21')](_0x278e61['query'][_0x4825('0x21')]);}_0x3a2801[_0x4825('0x39')]=qs[_0x4825('0x3a')](_0x278e61[_0x4825('0x32')][_0x4825('0x3a')]);_0x3a2801[_0x4825('0x3b')]=qs[_0x4825('0x3c')](_[_0x4825('0x3d')](_0x278e61[_0x4825('0x32')],_0x365484[_0x4825('0x3c')]),_0x310a83);if(_0x278e61[_0x4825('0x32')][_0x4825('0x3e')]){_0x3a2801[_0x4825('0x3b')]=_[_0x4825('0x3f')](_0x3a2801[_0x4825('0x3b')],{'$or':_[_0x4825('0x40')](_0x310a83,function(_0x313ea8){if(_0x313ea8[_0x4825('0x41')]!==_0x4825('0x42')){var _0x39d285={};_0x39d285[_0x313ea8[_0x4825('0x2c')]]={'$like':'%'+_0x278e61[_0x4825('0x32')][_0x4825('0x3e')]+'%'};return _0x39d285;}})});}_0x3a2801=_[_0x4825('0x3f')]({},_0x3a2801,_0x278e61[_0x4825('0x43')]);var _0xbbd5f0={'where':_0x3a2801[_0x4825('0x3b')]};return db[_0x4825('0x2f')][_0x4825('0x20')](_0xbbd5f0)[_0x4825('0x27')](function(_0x4133b9){_0x4b5ba8[_0x4825('0x20')]=_0x4133b9;if(_0x278e61[_0x4825('0x32')][_0x4825('0x44')]){_0x3a2801['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x4825('0x45')](_0x3a2801);})[_0x4825('0x27')](function(_0x439f5e){_0x4b5ba8[_0x4825('0x46')]=_0x439f5e;return _0x4b5ba8;})['then'](respondWithFilteredResult(_0x805e85,_0x3a2801))['catch'](handleError(_0x805e85,null));};exports[_0x4825('0x47')]=function(_0x3fa83b,_0xb480f){var _0x44eeb8={'raw':![],'where':{'id':_0x3fa83b[_0x4825('0x48')]['id']}},_0x7c57d9={};_0x7c57d9[_0x4825('0x31')]=_[_0x4825('0x33')](db['AnalyticCustomReport'][_0x4825('0x30')]);_0x7c57d9[_0x4825('0x32')]=_[_0x4825('0x33')](_0x3fa83b[_0x4825('0x32')]);_0x7c57d9['filters']=_['intersection'](_0x7c57d9[_0x4825('0x31')],_0x7c57d9[_0x4825('0x32')]);_0x44eeb8['attributes']=_['intersection'](_0x7c57d9[_0x4825('0x31')],qs[_0x4825('0x36')](_0x3fa83b[_0x4825('0x32')][_0x4825('0x36')]));_0x44eeb8[_0x4825('0x35')]=_0x44eeb8['attributes'][_0x4825('0x37')]?_0x44eeb8[_0x4825('0x35')]:_0x7c57d9[_0x4825('0x31')];if(_0x3fa83b[_0x4825('0x32')][_0x4825('0x44')]){_0x44eeb8[_0x4825('0x49')]=[{'all':!![]}];}_0x44eeb8=_[_0x4825('0x3f')]({},_0x44eeb8,_0x3fa83b['options']);return db[_0x4825('0x2f')][_0x4825('0x4a')](_0x44eeb8)[_0x4825('0x27')](handleEntityNotFound(_0xb480f,null))['then'](respondWithResult(_0xb480f,null))['catch'](handleError(_0xb480f,null));};exports['create']=function(_0x769163,_0x13ccb1){return db[_0x4825('0x2f')][_0x4825('0x4b')](_0x769163['body'],{})['then'](function(_0x84358a){var _0x31cdde=_0x769163[_0x4825('0x4c')][_0x4825('0x4d')]({'plain':!![]});if(!_0x31cdde)throw new Error(_0x4825('0x4e'));if(_0x31cdde[_0x4825('0x4f')]===_0x4825('0x4c')){var _0x4fa7b3=_0x84358a[_0x4825('0x4d')]({'plain':!![]});var _0xf8eaf1=_0x4825('0x50');return db['UserProfileSection'][_0x4825('0x4a')]({'where':{'name':_0xf8eaf1,'userProfileId':_0x31cdde[_0x4825('0x51')]},'raw':!![]})[_0x4825('0x27')](function(_0x337d63){if(_0x337d63&&_0x337d63['autoAssociation']===0x0){return db[_0x4825('0x29')][_0x4825('0x4b')]({'name':_0x4fa7b3[_0x4825('0x2c')],'resourceId':_0x4fa7b3['id'],'type':_0x4825('0x28'),'sectionId':_0x337d63['id']},{})[_0x4825('0x27')](function(){return _0x84358a;});}else{return _0x84358a;}})['catch'](function(_0x52d70d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52d70d);throw _0x52d70d;});}return _0x84358a;})[_0x4825('0x27')](respondWithResult(_0x13ccb1,0xc9))[_0x4825('0x52')](handleError(_0x13ccb1,null));};exports[_0x4825('0x26')]=function(_0x1dbe4a,_0x32dd8e){if(_0x1dbe4a[_0x4825('0x53')]['id']){delete _0x1dbe4a['body']['id'];}return db[_0x4825('0x2f')][_0x4825('0x4a')]({'where':{'id':_0x1dbe4a[_0x4825('0x48')]['id']}})[_0x4825('0x27')](handleEntityNotFound(_0x32dd8e,null))[_0x4825('0x27')](saveUpdates(_0x1dbe4a['body'],null))[_0x4825('0x27')](respondWithResult(_0x32dd8e,null))[_0x4825('0x52')](handleError(_0x32dd8e,null));};exports['destroy']=function(_0x39dc7e,_0x163464){return db[_0x4825('0x2f')][_0x4825('0x4a')]({'where':{'id':_0x39dc7e['params']['id']}})[_0x4825('0x27')](handleEntityNotFound(_0x163464,null))[_0x4825('0x27')](removeEntity(_0x163464,null))[_0x4825('0x52')](handleError(_0x163464,null));};exports[_0x4825('0x54')]=function(_0x4bd836,_0x28a474){var _0x14834f=0xa;var _0x29b98b=[_0x4825('0x55'),'left_join',_0x4825('0x56'),_0x4825('0x57')];var _0x54882f={'SUM':_0x4825('0x58'),'COUNT':_0x4825('0x59'),'COUNT DISTINCT':_0x4825('0x5a'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4825('0x5b'),'GROUP_CONCAT':_0x4825('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4825('0x5d')};var _0x31aec7={'SEC_TO_TIME':_0x4825('0x5e'),'DATE':_0x4825('0x5f'),'HOUR':_0x4825('0x60'),'ROUND':_0x4825('0x61'),'UNIX_TIMESTAMP':_0x4825('0x62')};var _0x427b9b=function(_0x2f2405){return!_[_0x4825('0x63')](['IS\x20NULL',_0x4825('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2f2405);};var _0x3e5d3f=function(_0xac2ab6){if(!_0xac2ab6||!_0xac2ab6[_0x4825('0x65')][_0x4825('0x37')]){return'';}for(var _0x3bb0f3='(',_0x1d2a4d=0x0;_0x1d2a4d<_0xac2ab6[_0x4825('0x65')][_0x4825('0x37')];_0x1d2a4d+=0x1){_0x1d2a4d>0x0&&(_0x3bb0f3+='\x20'+_0xac2ab6[_0x4825('0x66')]+'\x20');_0x3bb0f3+=_0xac2ab6[_0x4825('0x65')][_0x1d2a4d][_0x4825('0x67')]?_0x3e5d3f(_0xac2ab6[_0x4825('0x65')][_0x1d2a4d]['group']):_0xac2ab6[_0x4825('0x65')][_0x1d2a4d][_0x4825('0x68')]+'\x20'+_0xac2ab6[_0x4825('0x65')][_0x1d2a4d][_0x4825('0x69')]+(_0x427b9b(_0xac2ab6[_0x4825('0x65')][_0x1d2a4d]['condition'])?'\x20'+_0xac2ab6[_0x4825('0x65')][_0x1d2a4d]['value']:'');}return _0x3bb0f3+')';};var _0x25b04c={'where':{'id':_0x4bd836[_0x4825('0x48')]['id']}},_0x16e9e2,_0x321136,_0xf1edb1,_0x193ac0,_0x25509a;_0x25b04c=_[_0x4825('0x3f')]({},_0x25b04c,_0x4bd836[_0x4825('0x43')]);return db[_0x4825('0x2f')]['find'](_0x25b04c)['then'](function(_0x42854a){if(_0x42854a){_0x16e9e2=_0x42854a;return _0x42854a[_0x4825('0x6a')]();}return null;})[_0x4825('0x27')](function(_0x53e86d){if(_0x53e86d){if(!_0x53e86d['length']){throw new db[(_0x4825('0x6b'))][(_0x4825('0x6c'))](_0x4825('0x6d'),0x193);}_0x321136=_0x53e86d;return db[_0x4825('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x4825('0x27')](function(_0x5a3178){if(_0x5a3178){_0xf1edb1=_[_0x4825('0x6f')](_0x5a3178,'id');var _0x51ec41;var _0x4a6b1f=squel[_0x4825('0x70')]();_0x4a6b1f[_0x4825('0x71')](_0x16e9e2[_0x4825('0x72')]);for(var _0x5b6b03=0x0;_0x5b6b03<_0x321136[_0x4825('0x37')];_0x5b6b03+=0x1){_0x51ec41=_0x321136[_0x5b6b03][_0x4825('0x73')]?_0xf1edb1[_0x321136[_0x5b6b03]['MetricId']]['metric']:_0x321136[_0x5b6b03]['field'];_0x51ec41=_0x321136[_0x5b6b03][_0x4825('0x74')]?_['replace'](_0x54882f[_0x321136[_0x5b6b03][_0x4825('0x74')]],'%s',_0x51ec41):_0x51ec41;_0x51ec41=_0x321136[_0x5b6b03][_0x4825('0x75')]?_[_0x4825('0x76')](_0x31aec7[_0x321136[_0x5b6b03][_0x4825('0x75')]],'%s',_0x51ec41):_0x51ec41;if(_0x321136[_0x5b6b03][_0x4825('0x77')]){_0x4a6b1f[_0x4825('0x67')](_0x51ec41);}_0x321136[_0x5b6b03][_0x4825('0x78')]&&_0x4a6b1f[_0x4825('0x39')](_0x51ec41,_0x321136[_0x5b6b03][_0x4825('0x78')]===_0x4825('0x79')?![]:!![]);_0x4a6b1f['field'](_0x51ec41,_0x321136[_0x5b6b03][_0x4825('0x7a')]||_0x51ec41);}if(_0x16e9e2['joins']){_0x16e9e2[_0x4825('0x7b')]=JSON[_0x4825('0x7c')](_0x16e9e2[_0x4825('0x7b')]);for(var _0x3cec21=0x0;_0x3cec21<_0x16e9e2['joins'][_0x4825('0x37')];_0x3cec21+=0x1){if(_0x16e9e2[_0x4825('0x7b')][_0x3cec21][_0x4825('0x41')]&&_[_0x4825('0x63')](_0x29b98b,_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['type'])&&_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['parentKey']&&_0x16e9e2[_0x4825('0x7b')][_0x3cec21][_0x4825('0x7d')]&&_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['foreignKey']){_0x4a6b1f[_0x16e9e2['joins'][_0x3cec21][_0x4825('0x41')]](_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x16e9e2['table'],_0x16e9e2[_0x4825('0x7b')][_0x3cec21]['parentKey'],_0x16e9e2['joins'][_0x3cec21][_0x4825('0x7d')],_0x16e9e2[_0x4825('0x7b')][_0x3cec21][_0x4825('0x7e')]));}}}if(_0x16e9e2[_0x4825('0x7f')]){_0x16e9e2[_0x4825('0x7f')]=JSON['parse'](_0x16e9e2[_0x4825('0x7f')]);_0x4a6b1f['where'](_0x3e5d3f(_0x16e9e2[_0x4825('0x7f')]['group']));}_0x25509a=_0x4a6b1f[_0x4825('0x80')]();_0x4a6b1f[_0x4825('0x1f')](_0x14834f);_0x4a6b1f[_0x4825('0x21')](0x0);logger[_0x4825('0x81')](_0x4825('0x82'),_0x4a6b1f[_0x4825('0x83')]());return dbH['sequelize'][_0x4825('0x32')](_0x4a6b1f[_0x4825('0x83')](),{'type':dbH[_0x4825('0x84')]['QueryTypes'][_0x4825('0x85')]});}})[_0x4825('0x27')](respondWithResult(_0x28a474,null))[_0x4825('0x52')](handleError(_0x28a474,null));};function runReport(_0x664198,_0x44f8a1,_0xf9487b){var _0x5e703e=_0x44f8a1[_0x4825('0x2c')];var _0x257248=0xa;var _0x5ca46f=[_0x4825('0x55'),_0x4825('0x86'),_0x4825('0x56'),_0x4825('0x57')];var _0x2025a0={'SUM':_0x4825('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4825('0x5a'),'MAX':'MAX(%s)','MIN':_0x4825('0x87'),'AVG':_0x4825('0x5b'),'GROUP_CONCAT':_0x4825('0x5c'),'GROUP_CONCAT ASC':_0x4825('0x88'),'GROUP_CONCAT DESC':_0x4825('0x5d')};var _0x2cccf2={'SEC_TO_TIME':_0x4825('0x5e'),'DATE':_0x4825('0x5f'),'HOUR':_0x4825('0x60'),'ROUND':_0x4825('0x61'),'UNIX_TIMESTAMP':_0x4825('0x62')};var _0x4284fc=function(_0x567c86){return!_['includes']([_0x4825('0x89'),_0x4825('0x64'),_0x4825('0x8a'),_0x4825('0x8b')],_0x567c86);};var _0x44a7a5=function(_0x113aec){if(!_0x113aec||!_0x113aec['rules'][_0x4825('0x37')]){return'';}for(var _0x51e687='(',_0x4c803c=0x0;_0x4c803c<_0x113aec[_0x4825('0x65')][_0x4825('0x37')];_0x4c803c+=0x1){_0x4c803c>0x0&&(_0x51e687+='\x20'+_0x113aec[_0x4825('0x66')]+'\x20');_0x51e687+=_0x113aec[_0x4825('0x65')][_0x4c803c][_0x4825('0x67')]?_0x44a7a5(_0x113aec[_0x4825('0x65')][_0x4c803c]['group']):_0x113aec[_0x4825('0x65')][_0x4c803c][_0x4825('0x68')]+'\x20'+_0x113aec['rules'][_0x4c803c][_0x4825('0x69')]+(_0x4284fc(_0x113aec[_0x4825('0x65')][_0x4c803c][_0x4825('0x69')])?'\x20'+_0x113aec[_0x4825('0x65')][_0x4c803c][_0x4825('0x8c')]:'');}return _0x51e687+')';};var _0x2e2ae9={'where':{'id':_0x664198['id']}},_0x24c83b,_0x221de7,_0x5055c5,_0x4bd0a2,_0x11356d;_0x2e2ae9=_[_0x4825('0x3f')]({},_0x2e2ae9,_0xf9487b);return db[_0x4825('0x2f')]['find'](_0x2e2ae9)[_0x4825('0x27')](function(_0x1b83dd){if(_0x1b83dd){_0x24c83b=_0x1b83dd;return _0x1b83dd['getFields']();}return null;})['then'](function(_0x13c874){if(_0x13c874){if(!_0x13c874[_0x4825('0x37')]){throw new db[(_0x4825('0x6b'))][(_0x4825('0x6c'))](_0x4825('0x6d'),0x193);}_0x221de7=_0x13c874;return db['AnalyticMetric'][_0x4825('0x45')]({'raw':!![]});}return null;})[_0x4825('0x27')](function(_0x583cd1){if(_0x583cd1){_0x5055c5=_[_0x4825('0x6f')](_0x583cd1,'id');var _0x2784ba;var _0x5c2164=squel[_0x4825('0x70')]();_0x5c2164[_0x4825('0x71')](_0x24c83b['table']);for(var _0x1c8ce1=0x0;_0x1c8ce1<_0x221de7[_0x4825('0x37')];_0x1c8ce1+=0x1){_0x2784ba=_0x221de7[_0x1c8ce1][_0x4825('0x73')]?_0x5055c5[_0x221de7[_0x1c8ce1][_0x4825('0x73')]]['metric']:_0x221de7[_0x1c8ce1][_0x4825('0x68')];_0x2784ba=_0x221de7[_0x1c8ce1][_0x4825('0x74')]?_['replace'](_0x2025a0[_0x221de7[_0x1c8ce1][_0x4825('0x74')]],'%s',_0x2784ba):_0x2784ba;_0x2784ba=_0x221de7[_0x1c8ce1][_0x4825('0x75')]?_['replace'](_0x2cccf2[_0x221de7[_0x1c8ce1]['format']],'%s',_0x2784ba):_0x2784ba;if(_0x221de7[_0x1c8ce1][_0x4825('0x77')]){_0x5c2164['group'](_0x2784ba);}_0x221de7[_0x1c8ce1][_0x4825('0x78')]&&_0x5c2164[_0x4825('0x39')](_0x2784ba,_0x221de7[_0x1c8ce1][_0x4825('0x78')]===_0x4825('0x79')?![]:!![]);_0x5c2164['field'](_0x2784ba,_0x221de7[_0x1c8ce1][_0x4825('0x7a')]||_0x2784ba);}if(_0x24c83b['joins']){_0x24c83b['joins']=JSON[_0x4825('0x7c')](_0x24c83b[_0x4825('0x7b')]);for(var _0x580585=0x0;_0x580585<_0x24c83b[_0x4825('0x7b')][_0x4825('0x37')];_0x580585+=0x1){if(_0x24c83b['joins'][_0x580585][_0x4825('0x41')]&&_[_0x4825('0x63')](_0x5ca46f,_0x24c83b['joins'][_0x580585][_0x4825('0x41')])&&_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x8d')]&&_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x7d')]&&_0x24c83b[_0x4825('0x7b')][_0x580585]['foreignKey']){_0x5c2164[_0x24c83b[_0x4825('0x7b')][_0x580585]['type']](_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x7d')],null,util[_0x4825('0x75')]('%s.%s\x20=\x20%s.%s',_0x24c83b[_0x4825('0x72')],_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x8d')],_0x24c83b['joins'][_0x580585][_0x4825('0x7d')],_0x24c83b[_0x4825('0x7b')][_0x580585][_0x4825('0x7e')]));}}}if(_0x24c83b[_0x4825('0x7f')]){_0x24c83b[_0x4825('0x7f')]=JSON['parse'](_0x24c83b['conditions']);_0x5c2164['where'](_0x44a7a5(_0x24c83b[_0x4825('0x7f')][_0x4825('0x67')]));}_0x11356d=_0x5c2164[_0x4825('0x80')]();_0x5c2164['limit'](_0x257248);_0x5c2164['offset'](0x0);return;}})[_0x4825('0x27')](function(){if(_0x44f8a1['output']===_0x4825('0x8e')){return null;}var _0x2dc4df=_[_0x4825('0x3f')](_0x44f8a1,{'name':_0x44f8a1['fullPath']||_0x44f8a1['name']||_0x24c83b[_0x4825('0x2c')],'basename':_0x5e703e,'savename':util[_0x4825('0x75')](_0x4825('0x8f'),_0x44f8a1[_0x4825('0x2c')]||_0x24c83b[_0x4825('0x2c')],require(_0x4825('0x90'))[_0x4825('0x91')](0x4),_0x44f8a1[_0x4825('0x92')]||_0x4825('0x93')),'reportId':_0x24c83b['id'],'reportType':_0x4825('0x94')});return db[_0x4825('0x95')][_0x4825('0x4b')](_0x2dc4df,{'raw':!![]});})[_0x4825('0x27')](function(_0x1ae768){if(_0x24c83b[_0x4825('0x72')]===_0x4825('0x96')){_0x11356d[_0x4825('0x3b')](_0x24c83b[_0x4825('0x72')]+_0x4825('0x97'),_0x44f8a1[_0x4825('0x98')],_0x44f8a1[_0x4825('0x99')]);}else{_0x11356d['where'](_0x24c83b[_0x4825('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x44f8a1[_0x4825('0x98')],_0x44f8a1[_0x4825('0x99')]);}if(_0x1ae768){logger[_0x4825('0x9a')]('Run\x20Query:',_0x11356d['toString']());require(_0x4825('0x9b'))[_0x4825('0x9c')](path[_0x4825('0x55')](__dirname,_0x4825('0x9d'),_0x1ae768[_0x4825('0x92')]),[_0x1ae768['id'],_0x11356d[_0x4825('0x83')](),path[_0x4825('0x55')](__dirname,_0x4825('0x9e'),_0x1ae768[_0x4825('0x9f')]),_0x5e703e]);return _0x1ae768;}else{var _0x1a63c7=squel['select']();_0x1a63c7[_0x4825('0x71')]('('+_0x11356d['toString']()+')',_0x4825('0xa0'));_0x1a63c7[_0x4825('0x68')](_0x4825('0xa1'),_0x4825('0x20'));_0x11356d['limit'](_0x44f8a1[_0x4825('0x1f')]||_0x257248);_0x11356d[_0x4825('0x21')](_0x44f8a1['offset']||0x0);return dbH[_0x4825('0x84')]['query'](_0x1a63c7[_0x4825('0x83')](),{'type':dbH[_0x4825('0x84')]['QueryTypes'][_0x4825('0x85')]})['then'](function(_0xe3bba){if(!_0xe3bba['length']){_0x4bd0a2=0x0;}else{_0x4bd0a2=_0xe3bba[0x0][_0x4825('0x20')]||0x0;}return dbH[_0x4825('0x84')][_0x4825('0x32')](_0x11356d[_0x4825('0x83')](),{'type':dbH[_0x4825('0x84')][_0x4825('0xa2')][_0x4825('0x85')]});})[_0x4825('0x27')](function(_0x4073cf){return{'rows':_0x4073cf||[],'count':_0x4bd0a2};});}});}exports[_0x4825('0xa3')]=function(_0x3d6e76,_0xaf1048){return runReport(_0x3d6e76['params'],_0x3d6e76[_0x4825('0x32')],_0x3d6e76[_0x4825('0x43')])[_0x4825('0x27')](respondWithResult(_0xaf1048,null))[_0x4825('0x52')](handleError(_0xaf1048,null));};exports[_0x4825('0xa4')]=runReport;exports[_0x4825('0x32')]=function(_0x1ccb72,_0x53d9c7){var _0x31d02e=0xa;var _0x435592=[_0x4825('0x55'),_0x4825('0x86'),_0x4825('0x56'),'cross_join'];var _0x428df7={'SUM':_0x4825('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4825('0x5a'),'MAX':_0x4825('0xa5'),'MIN':_0x4825('0x87'),'AVG':_0x4825('0x5b'),'GROUP_CONCAT':_0x4825('0x5c'),'GROUP_CONCAT ASC':_0x4825('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x21f97b={'SEC_TO_TIME':_0x4825('0x5e'),'DATE':_0x4825('0x5f'),'HOUR':_0x4825('0x60'),'ROUND':_0x4825('0x61'),'UNIX_TIMESTAMP':_0x4825('0x62')};var _0x4d43af=function(_0x8bfa67){return!_[_0x4825('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x4825('0x8a'),_0x4825('0x8b')],_0x8bfa67);};var _0x53bfe7=function(_0x1bb77c){if(!_0x1bb77c||!_0x1bb77c[_0x4825('0x65')][_0x4825('0x37')]){return'';}for(var _0x4e398c='(',_0x9bf3df=0x0;_0x9bf3df<_0x1bb77c[_0x4825('0x65')][_0x4825('0x37')];_0x9bf3df+=0x1){_0x9bf3df>0x0&&(_0x4e398c+='\x20'+_0x1bb77c[_0x4825('0x66')]+'\x20');_0x4e398c+=_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x67')]?_0x53bfe7(_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x67')]):_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x68')]+'\x20'+_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x69')]+(_0x4d43af(_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x69')])?'\x20'+_0x1bb77c[_0x4825('0x65')][_0x9bf3df][_0x4825('0x8c')]:'');}return _0x4e398c+')';};var _0x3a91c7={'where':{'id':_0x1ccb72[_0x4825('0x48')]['id']}},_0x4203ed,_0x10c1b9,_0x39a714,_0x20b212,_0xf4efab;_0x3a91c7=_[_0x4825('0x3f')]({},_0x3a91c7,_0x1ccb72['options']);return db[_0x4825('0x2f')][_0x4825('0x4a')](_0x3a91c7)['then'](function(_0xd78be1){if(_0xd78be1){_0x4203ed=_0xd78be1;return _0xd78be1[_0x4825('0x6a')]();}return null;})[_0x4825('0x27')](function(_0x40efcd){if(_0x40efcd){if(!_0x40efcd[_0x4825('0x37')]){throw new db['Sequelize'][(_0x4825('0x6c'))](_0x4825('0x6d'),0x193);}_0x10c1b9=_0x40efcd;return db[_0x4825('0x6e')][_0x4825('0x45')]({'raw':!![]});}return null;})[_0x4825('0x27')](function(_0x286560){if(_0x286560){_0x39a714=_[_0x4825('0x6f')](_0x286560,'id');var _0x845681;var _0x11266a=squel['select']();_0x11266a['from'](_0x4203ed[_0x4825('0x72')]);for(var _0x44408b=0x0;_0x44408b<_0x10c1b9[_0x4825('0x37')];_0x44408b+=0x1){_0x845681=_0x10c1b9[_0x44408b][_0x4825('0x73')]?_0x39a714[_0x10c1b9[_0x44408b]['MetricId']][_0x4825('0xa6')]:_0x10c1b9[_0x44408b][_0x4825('0x68')];_0x845681=_0x10c1b9[_0x44408b][_0x4825('0x74')]?_[_0x4825('0x76')](_0x428df7[_0x10c1b9[_0x44408b][_0x4825('0x74')]],'%s',_0x845681):_0x845681;_0x845681=_0x10c1b9[_0x44408b]['format']?_['replace'](_0x21f97b[_0x10c1b9[_0x44408b][_0x4825('0x75')]],'%s',_0x845681):_0x845681;if(_0x10c1b9[_0x44408b][_0x4825('0x77')]){_0x11266a[_0x4825('0x67')](_0x845681);}_0x10c1b9[_0x44408b]['orderBy']&&_0x11266a['order'](_0x845681,_0x10c1b9[_0x44408b][_0x4825('0x78')]===_0x4825('0x79')?![]:!![]);_0x11266a[_0x4825('0x68')](_0x845681,_0x10c1b9[_0x44408b]['alias']||_0x845681);}if(_0x4203ed['joins']){_0x4203ed[_0x4825('0x7b')]=JSON[_0x4825('0x7c')](_0x4203ed[_0x4825('0x7b')]);for(var _0x5beb28=0x0;_0x5beb28<_0x4203ed[_0x4825('0x7b')][_0x4825('0x37')];_0x5beb28+=0x1){if(_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x41')]&&_[_0x4825('0x63')](_0x435592,_0x4203ed[_0x4825('0x7b')][_0x5beb28]['type'])&&_0x4203ed[_0x4825('0x7b')][_0x5beb28]['parentKey']&&_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x7d')]&&_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x7e')]){_0x11266a[_0x4203ed['joins'][_0x5beb28][_0x4825('0x41')]](_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x7d')],null,util['format'](_0x4825('0xa7'),_0x4203ed[_0x4825('0x72')],_0x4203ed['joins'][_0x5beb28]['parentKey'],_0x4203ed[_0x4825('0x7b')][_0x5beb28][_0x4825('0x7d')],_0x4203ed['joins'][_0x5beb28][_0x4825('0x7e')]));}}}if(_0x4203ed[_0x4825('0x7f')]){_0x4203ed[_0x4825('0x7f')]=JSON[_0x4825('0x7c')](_0x4203ed[_0x4825('0x7f')]);_0x11266a[_0x4825('0x3b')](_0x53bfe7(_0x4203ed[_0x4825('0x7f')][_0x4825('0x67')]));}_0xf4efab=_0x11266a[_0x4825('0x80')]();_0x11266a[_0x4825('0x1f')](_0x31d02e);_0x11266a['offset'](0x0);logger[_0x4825('0x81')](_0x4825('0x82'),_0x11266a['toString']());return dbH[_0x4825('0x84')][_0x4825('0x32')](_0x11266a[_0x4825('0x83')](),{'type':dbH[_0x4825('0x84')][_0x4825('0xa2')][_0x4825('0x85')]});}})[_0x4825('0x27')](function(){return{'sql':_0xf4efab['toString']()};})[_0x4825('0x27')](respondWithResult(_0x53d9c7,null))[_0x4825('0x52')](handleError(_0x53d9c7,null));};
\ No newline at end of file
+var _0x0cef=['SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','group','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20NOT\x20EMPTY','table','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','toString','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','metric','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','role','CustomReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%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)'];(function(_0x450e1f,_0x485e1d){var _0x167d06=function(_0x1edd10){while(--_0x1edd10){_0x450e1f['push'](_0x450e1f['shift']());}};_0x167d06(++_0x485e1d);}(_0x0cef,0xe0));var _0xf0ce=function(_0x45adaf,_0x21c3c1){_0x45adaf=_0x45adaf-0x0;var _0x15d189=_0x0cef[_0x45adaf];return _0x15d189;};'use strict';var emlformat=require(_0xf0ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ce('0x1'));var jsonpatch=require(_0xf0ce('0x2'));var rp=require(_0xf0ce('0x3'));var moment=require(_0xf0ce('0x4'));var BPromise=require(_0xf0ce('0x5'));var Mustache=require(_0xf0ce('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf0ce('0x7'));var csv=require(_0xf0ce('0x8'));var ejs=require(_0xf0ce('0x9'));var fs=require('fs');var fs_extra=require(_0xf0ce('0xa'));var _=require('lodash');var squel=require(_0xf0ce('0xb'));var crypto=require(_0xf0ce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf0ce('0xd'));var toCsv=require(_0xf0ce('0x8'));var querystring=require(_0xf0ce('0xe'));var Papa=require(_0xf0ce('0xf'));var Redis=require(_0xf0ce('0x10'));var authService=require(_0xf0ce('0x11'));var qs=require(_0xf0ce('0x12'));var as=require(_0xf0ce('0x13'));var hardwareService=require(_0xf0ce('0x14'));var logger=require(_0xf0ce('0x15'))('api');var utils=require(_0xf0ce('0x16'));var config=require(_0xf0ce('0x17'));var licenseUtil=require(_0xf0ce('0x18'));var db=require(_0xf0ce('0x19'))['db'];var dbH=require(_0xf0ce('0x19'))['dbH'];function respondWithStatusCode(_0x599ff9,_0x1a5a6a){_0x1a5a6a=_0x1a5a6a||0xcc;return function(_0x430181){if(_0x430181){return _0x599ff9[_0xf0ce('0x1a')](_0x1a5a6a);}return _0x599ff9['status'](_0x1a5a6a)[_0xf0ce('0x1b')]();};}function respondWithResult(_0x2f4915,_0x544c55){_0x544c55=_0x544c55||0xc8;return function(_0x130661){if(_0x130661){return _0x2f4915[_0xf0ce('0x1c')](_0x544c55)[_0xf0ce('0x1d')](_0x130661);}};}function respondWithFilteredResult(_0x2300fe,_0x5c053c){return function(_0x3612ef){if(_0x3612ef){var _0x4a34ff=typeof _0x5c053c['offset']===_0xf0ce('0x1e')&&typeof _0x5c053c[_0xf0ce('0x1f')]==='undefined';var _0xd4e389=_0x3612ef[_0xf0ce('0x20')];var _0x7d1dac=_0x4a34ff?0x0:_0x5c053c[_0xf0ce('0x21')];var _0x4d7ce8=_0x4a34ff?_0x3612ef['count']:_0x5c053c[_0xf0ce('0x21')]+_0x5c053c[_0xf0ce('0x1f')];var _0x485a91;if(_0x4d7ce8>=_0xd4e389){_0x4d7ce8=_0xd4e389;_0x485a91=0xc8;}else{_0x485a91=0xce;}_0x2300fe[_0xf0ce('0x1c')](_0x485a91);return _0x2300fe[_0xf0ce('0x22')]('Content-Range',_0x7d1dac+'-'+_0x4d7ce8+'/'+_0xd4e389)['json'](_0x3612ef);}return null;};}function patchUpdates(_0x12bc04){return function(_0x3bc652){try{jsonpatch[_0xf0ce('0x23')](_0x3bc652,_0x12bc04,!![]);}catch(_0x5d1db5){return BPromise[_0xf0ce('0x24')](_0x5d1db5);}return _0x3bc652[_0xf0ce('0x25')]();};}function saveUpdates(_0x594015,_0x419999){return function(_0x126177){if(_0x126177){return _0x126177['update'](_0x594015)[_0xf0ce('0x26')](function(_0x50006e){return _0x50006e;});}return null;};}function removeEntity(_0x429f72,_0x3c637b){return function(_0x43d03a){if(_0x43d03a){return _0x43d03a['destroy']()[_0xf0ce('0x26')](function(){var _0x27ed97=_0x43d03a[_0xf0ce('0x27')]({'plain':!![]});var _0x55a42b='CustomReports';return db[_0xf0ce('0x28')]['destroy']({'where':{'type':_0x55a42b,'resourceId':_0x27ed97['id']}})['then'](function(){return _0x43d03a;});})[_0xf0ce('0x26')](function(){_0x429f72['status'](0xcc)[_0xf0ce('0x1b')]();});}};}function handleEntityNotFound(_0x280730,_0x501f1d){return function(_0xac6e5){if(!_0xac6e5){_0x280730[_0xf0ce('0x1a')](0x194);}return _0xac6e5;};}function handleError(_0x15505b,_0x1a796f){_0x1a796f=_0x1a796f||0x1f4;return function(_0x40533c){logger[_0xf0ce('0x29')](_0x40533c[_0xf0ce('0x2a')]);if(_0x40533c[_0xf0ce('0x2b')]){delete _0x40533c['name'];}_0x15505b[_0xf0ce('0x1c')](_0x1a796f)[_0xf0ce('0x2c')](_0x40533c);};}exports['index']=function(_0x57cc29,_0x3ddd44){var _0x1032f1={},_0x2ecf58={},_0x307875={'count':0x0,'rows':[]};var _0x308603=_['map'](db[_0xf0ce('0x2d')][_0xf0ce('0x2e')],function(_0x112c66){return{'name':_0x112c66['fieldName'],'type':_0x112c66[_0xf0ce('0x2f')][_0xf0ce('0x30')]};});_0x2ecf58[_0xf0ce('0x31')]=_[_0xf0ce('0x32')](_0x308603,_0xf0ce('0x2b'));_0x2ecf58[_0xf0ce('0x33')]=_[_0xf0ce('0x34')](_0x57cc29[_0xf0ce('0x33')]);_0x2ecf58[_0xf0ce('0x35')]=_['intersection'](_0x2ecf58[_0xf0ce('0x31')],_0x2ecf58[_0xf0ce('0x33')]);_0x1032f1[_0xf0ce('0x36')]=_[_0xf0ce('0x37')](_0x2ecf58[_0xf0ce('0x31')],qs['fields'](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x38')]));_0x1032f1[_0xf0ce('0x36')]=_0x1032f1[_0xf0ce('0x36')][_0xf0ce('0x39')]?_0x1032f1[_0xf0ce('0x36')]:_0x2ecf58[_0xf0ce('0x31')];if(!_0x57cc29['query']['hasOwnProperty']('nolimit')){_0x1032f1[_0xf0ce('0x1f')]=qs['limit'](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x1f')]);_0x1032f1[_0xf0ce('0x21')]=qs[_0xf0ce('0x21')](_0x57cc29['query'][_0xf0ce('0x21')]);}_0x1032f1[_0xf0ce('0x3a')]=qs[_0xf0ce('0x3b')](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3b')]);_0x1032f1[_0xf0ce('0x3c')]=qs[_0xf0ce('0x35')](_[_0xf0ce('0x3d')](_0x57cc29[_0xf0ce('0x33')],_0x2ecf58['filters']),_0x308603);if(_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3e')]){_0x1032f1[_0xf0ce('0x3c')]=_[_0xf0ce('0x3f')](_0x1032f1[_0xf0ce('0x3c')],{'$or':_['map'](_0x308603,function(_0x1aba99){if(_0x1aba99['type']!==_0xf0ce('0x40')){var _0xa4de4e={};_0xa4de4e[_0x1aba99[_0xf0ce('0x2b')]]={'$like':'%'+_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3e')]+'%'};return _0xa4de4e;}})});}_0x1032f1=_[_0xf0ce('0x3f')]({},_0x1032f1,_0x57cc29[_0xf0ce('0x41')]);var _0x37dc3e={'where':_0x1032f1[_0xf0ce('0x3c')]};return db[_0xf0ce('0x2d')]['count'](_0x37dc3e)['then'](function(_0x4348e9){_0x307875['count']=_0x4348e9;if(_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x42')]){_0x1032f1[_0xf0ce('0x43')]=[{'all':!![]}];}return db[_0xf0ce('0x2d')][_0xf0ce('0x44')](_0x1032f1);})['then'](function(_0xc4382a){_0x307875[_0xf0ce('0x45')]=_0xc4382a;return _0x307875;})[_0xf0ce('0x26')](respondWithFilteredResult(_0x3ddd44,_0x1032f1))['catch'](handleError(_0x3ddd44,null));};exports[_0xf0ce('0x46')]=function(_0x4349e7,_0x254478){var _0x3bbf41={'raw':![],'where':{'id':_0x4349e7[_0xf0ce('0x47')]['id']}},_0x4c650d={};_0x4c650d['model']=_[_0xf0ce('0x34')](db[_0xf0ce('0x2d')][_0xf0ce('0x2e')]);_0x4c650d['query']=_[_0xf0ce('0x34')](_0x4349e7[_0xf0ce('0x33')]);_0x4c650d[_0xf0ce('0x35')]=_[_0xf0ce('0x37')](_0x4c650d[_0xf0ce('0x31')],_0x4c650d[_0xf0ce('0x33')]);_0x3bbf41[_0xf0ce('0x36')]=_[_0xf0ce('0x37')](_0x4c650d[_0xf0ce('0x31')],qs[_0xf0ce('0x38')](_0x4349e7[_0xf0ce('0x33')][_0xf0ce('0x38')]));_0x3bbf41[_0xf0ce('0x36')]=_0x3bbf41['attributes'][_0xf0ce('0x39')]?_0x3bbf41[_0xf0ce('0x36')]:_0x4c650d[_0xf0ce('0x31')];if(_0x4349e7['query'][_0xf0ce('0x42')]){_0x3bbf41[_0xf0ce('0x43')]=[{'all':!![]}];}_0x3bbf41=_[_0xf0ce('0x3f')]({},_0x3bbf41,_0x4349e7[_0xf0ce('0x41')]);return db['AnalyticCustomReport'][_0xf0ce('0x48')](_0x3bbf41)[_0xf0ce('0x26')](handleEntityNotFound(_0x254478,null))['then'](respondWithResult(_0x254478,null))['catch'](handleError(_0x254478,null));};exports[_0xf0ce('0x49')]=function(_0x194f90,_0x4955fe){return db['AnalyticCustomReport'][_0xf0ce('0x49')](_0x194f90[_0xf0ce('0x4a')],{})['then'](function(_0x5cc50a){var _0x259321=_0x194f90[_0xf0ce('0x4b')][_0xf0ce('0x27')]({'plain':!![]});if(!_0x259321)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x259321[_0xf0ce('0x4c')]==='user'){var _0x1a1738=_0x5cc50a['get']({'plain':!![]});var _0x3ce5da='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x3ce5da,'userProfileId':_0x259321['userProfileId']},'raw':!![]})[_0xf0ce('0x26')](function(_0x7f1189){if(_0x7f1189&&_0x7f1189['autoAssociation']===0x0){return db[_0xf0ce('0x28')][_0xf0ce('0x49')]({'name':_0x1a1738['name'],'resourceId':_0x1a1738['id'],'type':_0xf0ce('0x4d'),'sectionId':_0x7f1189['id']},{})[_0xf0ce('0x26')](function(){return _0x5cc50a;});}else{return _0x5cc50a;}})[_0xf0ce('0x4e')](function(_0x229a55){logger[_0xf0ce('0x29')](_0xf0ce('0x4f'),_0x229a55);throw _0x229a55;});}return _0x5cc50a;})[_0xf0ce('0x26')](respondWithResult(_0x4955fe,0xc9))[_0xf0ce('0x4e')](handleError(_0x4955fe,null));};exports[_0xf0ce('0x50')]=function(_0x41f350,_0x33fcc0){if(_0x41f350[_0xf0ce('0x4a')]['id']){delete _0x41f350['body']['id'];}return db[_0xf0ce('0x2d')]['find']({'where':{'id':_0x41f350['params']['id']}})[_0xf0ce('0x26')](handleEntityNotFound(_0x33fcc0,null))['then'](saveUpdates(_0x41f350[_0xf0ce('0x4a')],null))[_0xf0ce('0x26')](respondWithResult(_0x33fcc0,null))['catch'](handleError(_0x33fcc0,null));};exports['destroy']=function(_0x378a81,_0x5b5ee7){return db[_0xf0ce('0x2d')][_0xf0ce('0x48')]({'where':{'id':_0x378a81[_0xf0ce('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b5ee7,null))[_0xf0ce('0x26')](removeEntity(_0x5b5ee7,null))[_0xf0ce('0x4e')](handleError(_0x5b5ee7,null));};exports[_0xf0ce('0x51')]=function(_0x98e247,_0x2afd81){var _0x575d7d=0xa;var _0x1f3e58=[_0xf0ce('0x52'),_0xf0ce('0x53'),'right_join',_0xf0ce('0x54')];var _0x5a1c6d={'SUM':_0xf0ce('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':_0xf0ce('0x5a'),'GROUP_CONCAT DESC':_0xf0ce('0x5b')};var _0x16fea2={'SEC_TO_TIME':_0xf0ce('0x5c'),'DATE':'DATE(%s)','HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x11e8fe=function(_0x5bca08){return!_[_0xf0ce('0x60')]([_0xf0ce('0x61'),_0xf0ce('0x62'),_0xf0ce('0x63'),'IS\x20NOT\x20EMPTY'],_0x5bca08);};var _0x46f3a0=function(_0x22a36a){if(!_0x22a36a||!_0x22a36a['rules'][_0xf0ce('0x39')]){return'';}for(var _0x1f160e='(',_0x1151a7=0x0;_0x1151a7<_0x22a36a['rules'][_0xf0ce('0x39')];_0x1151a7+=0x1){_0x1151a7>0x0&&(_0x1f160e+='\x20'+_0x22a36a[_0xf0ce('0x64')]+'\x20');_0x1f160e+=_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x65')]?_0x46f3a0(_0x22a36a[_0xf0ce('0x66')][_0x1151a7][_0xf0ce('0x65')]):_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x67')]+'\x20'+_0x22a36a[_0xf0ce('0x66')][_0x1151a7]['condition']+(_0x11e8fe(_0x22a36a[_0xf0ce('0x66')][_0x1151a7][_0xf0ce('0x68')])?'\x20'+_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x69')]:'');}return _0x1f160e+')';};var _0x4be9c1={'where':{'id':_0x98e247[_0xf0ce('0x47')]['id']}},_0x4e66bc,_0x9e1efc,_0x28aed4,_0x1f9d63,_0x36be17;_0x4be9c1=_[_0xf0ce('0x3f')]({},_0x4be9c1,_0x98e247[_0xf0ce('0x41')]);return db['AnalyticCustomReport'][_0xf0ce('0x48')](_0x4be9c1)[_0xf0ce('0x26')](function(_0x479653){if(_0x479653){_0x4e66bc=_0x479653;return _0x479653[_0xf0ce('0x6a')]();}return null;})['then'](function(_0x3273ea){if(_0x3273ea){if(!_0x3273ea[_0xf0ce('0x39')]){throw new db[(_0xf0ce('0x6b'))][(_0xf0ce('0x6c'))](_0xf0ce('0x6d'),0x193);}_0x9e1efc=_0x3273ea;return db[_0xf0ce('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5a706c){if(_0x5a706c){_0x28aed4=_[_0xf0ce('0x6f')](_0x5a706c,'id');var _0x30c3df;var _0x23a282=squel[_0xf0ce('0x70')]();_0x23a282[_0xf0ce('0x71')](_0x4e66bc['table']);for(var _0x705231=0x0;_0x705231<_0x9e1efc[_0xf0ce('0x39')];_0x705231+=0x1){_0x30c3df=_0x9e1efc[_0x705231][_0xf0ce('0x72')]?_0x28aed4[_0x9e1efc[_0x705231]['MetricId']]['metric']:_0x9e1efc[_0x705231][_0xf0ce('0x67')];_0x30c3df=_0x9e1efc[_0x705231]['function']?_['replace'](_0x5a1c6d[_0x9e1efc[_0x705231][_0xf0ce('0x73')]],'%s',_0x30c3df):_0x30c3df;_0x30c3df=_0x9e1efc[_0x705231][_0xf0ce('0x74')]?_[_0xf0ce('0x75')](_0x16fea2[_0x9e1efc[_0x705231]['format']],'%s',_0x30c3df):_0x30c3df;if(_0x9e1efc[_0x705231][_0xf0ce('0x76')]){_0x23a282[_0xf0ce('0x65')](_0x30c3df);}_0x9e1efc[_0x705231]['orderBy']&&_0x23a282[_0xf0ce('0x3a')](_0x30c3df,_0x9e1efc[_0x705231][_0xf0ce('0x77')]===_0xf0ce('0x78')?![]:!![]);_0x23a282[_0xf0ce('0x67')](_0x30c3df,_0x9e1efc[_0x705231]['alias']||_0x30c3df);}if(_0x4e66bc['joins']){_0x4e66bc[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x4e66bc[_0xf0ce('0x79')]);for(var _0x2ed129=0x0;_0x2ed129<_0x4e66bc[_0xf0ce('0x79')]['length'];_0x2ed129+=0x1){if(_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')]&&_[_0xf0ce('0x60')](_0x1f3e58,_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')])&&_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7b')]&&_0x4e66bc['joins'][_0x2ed129][_0xf0ce('0x7c')]&&_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7d')]){_0x23a282[_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')]](_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7c')],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x4e66bc['table'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129]['parentKey'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129]['foreignTable'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7d')]));}}}if(_0x4e66bc['conditions']){_0x4e66bc['conditions']=JSON[_0xf0ce('0x7a')](_0x4e66bc[_0xf0ce('0x7f')]);_0x23a282[_0xf0ce('0x3c')](_0x46f3a0(_0x4e66bc[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x36be17=_0x23a282['clone']();_0x23a282[_0xf0ce('0x1f')](_0x575d7d);_0x23a282[_0xf0ce('0x21')](0x0);logger['debug'](_0xf0ce('0x80'),_0x23a282['toString']());return dbH[_0xf0ce('0x81')][_0xf0ce('0x33')](_0x23a282['toString'](),{'type':dbH['sequelize'][_0xf0ce('0x82')][_0xf0ce('0x83')]});}})['then'](respondWithResult(_0x2afd81,null))[_0xf0ce('0x4e')](handleError(_0x2afd81,null));};function runReport(_0x1d370f,_0xbb748f,_0x524053){var _0x4c358c=_0xbb748f[_0xf0ce('0x2b')];var _0x101fd6=0xa;var _0x532c13=[_0xf0ce('0x52'),_0xf0ce('0x53'),_0xf0ce('0x84'),_0xf0ce('0x54')];var _0x154a8f={'SUM':_0xf0ce('0x55'),'COUNT':_0xf0ce('0x85'),'COUNT DISTINCT':_0xf0ce('0x86'),'MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf0ce('0x5b')};var _0x5cdbf6={'SEC_TO_TIME':_0xf0ce('0x5c'),'DATE':_0xf0ce('0x87'),'HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x16ad05=function(_0x345c40){return!_['includes'](['IS\x20NULL',_0xf0ce('0x62'),_0xf0ce('0x63'),_0xf0ce('0x88')],_0x345c40);};var _0x525233=function(_0x17d82c){if(!_0x17d82c||!_0x17d82c[_0xf0ce('0x66')][_0xf0ce('0x39')]){return'';}for(var _0x321f73='(',_0x21560f=0x0;_0x21560f<_0x17d82c[_0xf0ce('0x66')][_0xf0ce('0x39')];_0x21560f+=0x1){_0x21560f>0x0&&(_0x321f73+='\x20'+_0x17d82c[_0xf0ce('0x64')]+'\x20');_0x321f73+=_0x17d82c[_0xf0ce('0x66')][_0x21560f]['group']?_0x525233(_0x17d82c[_0xf0ce('0x66')][_0x21560f]['group']):_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x67')]+'\x20'+_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x68')]+(_0x16ad05(_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x68')])?'\x20'+_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x69')]:'');}return _0x321f73+')';};var _0x2f3cbd={'where':{'id':_0x1d370f['id']}},_0x1c793c,_0x13ed5e,_0x4314a7,_0x354e43,_0x191683;_0x2f3cbd=_[_0xf0ce('0x3f')]({},_0x2f3cbd,_0x524053);return db[_0xf0ce('0x2d')][_0xf0ce('0x48')](_0x2f3cbd)[_0xf0ce('0x26')](function(_0xd20ebb){if(_0xd20ebb){_0x1c793c=_0xd20ebb;return _0xd20ebb[_0xf0ce('0x6a')]();}return null;})['then'](function(_0x1dc7b8){if(_0x1dc7b8){if(!_0x1dc7b8[_0xf0ce('0x39')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x13ed5e=_0x1dc7b8;return db[_0xf0ce('0x6e')][_0xf0ce('0x44')]({'raw':!![]});}return null;})[_0xf0ce('0x26')](function(_0x1725ba){if(_0x1725ba){_0x4314a7=_[_0xf0ce('0x6f')](_0x1725ba,'id');var _0x2278fb;var _0x1a07f0=squel[_0xf0ce('0x70')]();_0x1a07f0[_0xf0ce('0x71')](_0x1c793c[_0xf0ce('0x89')]);for(var _0x1ef550=0x0;_0x1ef550<_0x13ed5e[_0xf0ce('0x39')];_0x1ef550+=0x1){_0x2278fb=_0x13ed5e[_0x1ef550][_0xf0ce('0x72')]?_0x4314a7[_0x13ed5e[_0x1ef550][_0xf0ce('0x72')]]['metric']:_0x13ed5e[_0x1ef550][_0xf0ce('0x67')];_0x2278fb=_0x13ed5e[_0x1ef550]['function']?_[_0xf0ce('0x75')](_0x154a8f[_0x13ed5e[_0x1ef550][_0xf0ce('0x73')]],'%s',_0x2278fb):_0x2278fb;_0x2278fb=_0x13ed5e[_0x1ef550]['format']?_[_0xf0ce('0x75')](_0x5cdbf6[_0x13ed5e[_0x1ef550][_0xf0ce('0x74')]],'%s',_0x2278fb):_0x2278fb;if(_0x13ed5e[_0x1ef550]['groupBy']){_0x1a07f0[_0xf0ce('0x65')](_0x2278fb);}_0x13ed5e[_0x1ef550][_0xf0ce('0x77')]&&_0x1a07f0['order'](_0x2278fb,_0x13ed5e[_0x1ef550][_0xf0ce('0x77')]==='DESC'?![]:!![]);_0x1a07f0[_0xf0ce('0x67')](_0x2278fb,_0x13ed5e[_0x1ef550][_0xf0ce('0x8a')]||_0x2278fb);}if(_0x1c793c[_0xf0ce('0x79')]){_0x1c793c[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x1c793c['joins']);for(var _0x332fdd=0x0;_0x332fdd<_0x1c793c[_0xf0ce('0x79')]['length'];_0x332fdd+=0x1){if(_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x2f')]&&_[_0xf0ce('0x60')](_0x532c13,_0x1c793c['joins'][_0x332fdd][_0xf0ce('0x2f')])&&_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x7b')]&&_0x1c793c['joins'][_0x332fdd][_0xf0ce('0x7c')]&&_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignKey']){_0x1a07f0[_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['type']](_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignTable'],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x1c793c[_0xf0ce('0x89')],_0x1c793c['joins'][_0x332fdd]['parentKey'],_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x7c')],_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignKey']));}}}if(_0x1c793c['conditions']){_0x1c793c[_0xf0ce('0x7f')]=JSON['parse'](_0x1c793c[_0xf0ce('0x7f')]);_0x1a07f0[_0xf0ce('0x3c')](_0x525233(_0x1c793c[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x191683=_0x1a07f0['clone']();_0x1a07f0['limit'](_0x101fd6);_0x1a07f0[_0xf0ce('0x21')](0x0);return;}})[_0xf0ce('0x26')](function(){if(_0xbb748f[_0xf0ce('0x8b')]===_0xf0ce('0x8c')){return null;}var _0x13f6ac=_[_0xf0ce('0x3f')](_0xbb748f,{'name':_0xbb748f[_0xf0ce('0x8d')]||_0xbb748f[_0xf0ce('0x2b')]||_0x1c793c[_0xf0ce('0x2b')],'basename':_0x4c358c,'savename':util[_0xf0ce('0x74')](_0xf0ce('0x8e'),_0xbb748f[_0xf0ce('0x2b')]||_0x1c793c[_0xf0ce('0x2b')],require(_0xf0ce('0x8f'))[_0xf0ce('0x90')](0x4),_0xbb748f[_0xf0ce('0x8b')]||_0xf0ce('0x91')),'reportId':_0x1c793c['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xf0ce('0x49')](_0x13f6ac,{'raw':!![]});})[_0xf0ce('0x26')](function(_0x23f7cf){if(_0x1c793c[_0xf0ce('0x89')]==='cdr'){_0x191683['where'](_0x1c793c[_0xf0ce('0x89')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xbb748f[_0xf0ce('0x92')],_0xbb748f['endDate']);}else{_0x191683[_0xf0ce('0x3c')](_0x1c793c['table']+_0xf0ce('0x93'),_0xbb748f['startDate'],_0xbb748f['endDate']);}if(_0x23f7cf){logger['info']('Run\x20Query:',_0x191683[_0xf0ce('0x94')]());require('child_process')[_0xf0ce('0x95')](path[_0xf0ce('0x52')](__dirname,_0xf0ce('0x96'),_0x23f7cf['output']),[_0x23f7cf['id'],_0x191683[_0xf0ce('0x94')](),path[_0xf0ce('0x52')](__dirname,_0xf0ce('0x97'),_0x23f7cf[_0xf0ce('0x98')]),_0x4c358c]);return _0x23f7cf;}else{var _0x48c48f=squel[_0xf0ce('0x70')]();_0x48c48f[_0xf0ce('0x71')]('('+_0x191683[_0xf0ce('0x94')]()+')',_0xf0ce('0x99'));_0x48c48f[_0xf0ce('0x67')](_0xf0ce('0x9a'),'count');_0x191683[_0xf0ce('0x1f')](_0xbb748f['limit']||_0x101fd6);_0x191683[_0xf0ce('0x21')](_0xbb748f['offset']||0x0);return dbH['sequelize'][_0xf0ce('0x33')](_0x48c48f['toString'](),{'type':dbH[_0xf0ce('0x81')]['QueryTypes']['SELECT']})[_0xf0ce('0x26')](function(_0x5a9079){if(!_0x5a9079[_0xf0ce('0x39')]){_0x354e43=0x0;}else{_0x354e43=_0x5a9079[0x0]['count']||0x0;}return dbH[_0xf0ce('0x81')][_0xf0ce('0x33')](_0x191683[_0xf0ce('0x94')](),{'type':dbH[_0xf0ce('0x81')]['QueryTypes']['SELECT']});})[_0xf0ce('0x26')](function(_0x302ba0){return{'rows':_0x302ba0||[],'count':_0x354e43};});}});}exports['run']=function(_0x5e8650,_0x3ebbad){return runReport(_0x5e8650[_0xf0ce('0x47')],_0x5e8650[_0xf0ce('0x33')],_0x5e8650[_0xf0ce('0x41')])[_0xf0ce('0x26')](respondWithResult(_0x3ebbad,null))['catch'](handleError(_0x3ebbad,null));};exports[_0xf0ce('0x9b')]=runReport;exports[_0xf0ce('0x33')]=function(_0x149497,_0x5d3210){var _0x4f02bc=0xa;var _0x5adbf1=[_0xf0ce('0x52'),_0xf0ce('0x53'),_0xf0ce('0x84'),'cross_join'];var _0x2b2b2e={'SUM':_0xf0ce('0x55'),'COUNT':_0xf0ce('0x85'),'COUNT DISTINCT':_0xf0ce('0x86'),'MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3fd7f9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf0ce('0x87'),'HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x49785b=function(_0x2e0054){return!_[_0xf0ce('0x60')]([_0xf0ce('0x61'),_0xf0ce('0x62'),_0xf0ce('0x63'),_0xf0ce('0x88')],_0x2e0054);};var _0x43d753=function(_0x333b23){if(!_0x333b23||!_0x333b23['rules']['length']){return'';}for(var _0x3db831='(',_0xfdd3db=0x0;_0xfdd3db<_0x333b23[_0xf0ce('0x66')][_0xf0ce('0x39')];_0xfdd3db+=0x1){_0xfdd3db>0x0&&(_0x3db831+='\x20'+_0x333b23[_0xf0ce('0x64')]+'\x20');_0x3db831+=_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x65')]?_0x43d753(_0x333b23[_0xf0ce('0x66')][_0xfdd3db]['group']):_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x67')]+'\x20'+_0x333b23[_0xf0ce('0x66')][_0xfdd3db][_0xf0ce('0x68')]+(_0x49785b(_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x68')])?'\x20'+_0x333b23['rules'][_0xfdd3db]['value']:'');}return _0x3db831+')';};var _0x246e4f={'where':{'id':_0x149497['params']['id']}},_0x3fcdf0,_0x100b4a,_0x238651,_0x549783,_0x48fe42;_0x246e4f=_[_0xf0ce('0x3f')]({},_0x246e4f,_0x149497[_0xf0ce('0x41')]);return db[_0xf0ce('0x2d')][_0xf0ce('0x48')](_0x246e4f)[_0xf0ce('0x26')](function(_0x40ba6b){if(_0x40ba6b){_0x3fcdf0=_0x40ba6b;return _0x40ba6b[_0xf0ce('0x6a')]();}return null;})[_0xf0ce('0x26')](function(_0x56d82b){if(_0x56d82b){if(!_0x56d82b[_0xf0ce('0x39')]){throw new db[(_0xf0ce('0x6b'))][(_0xf0ce('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x100b4a=_0x56d82b;return db[_0xf0ce('0x6e')][_0xf0ce('0x44')]({'raw':!![]});}return null;})[_0xf0ce('0x26')](function(_0x33763e){if(_0x33763e){_0x238651=_[_0xf0ce('0x6f')](_0x33763e,'id');var _0x609d4d;var _0x5297d9=squel['select']();_0x5297d9[_0xf0ce('0x71')](_0x3fcdf0[_0xf0ce('0x89')]);for(var _0x577ce8=0x0;_0x577ce8<_0x100b4a[_0xf0ce('0x39')];_0x577ce8+=0x1){_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x72')]?_0x238651[_0x100b4a[_0x577ce8][_0xf0ce('0x72')]][_0xf0ce('0x9c')]:_0x100b4a[_0x577ce8][_0xf0ce('0x67')];_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x73')]?_[_0xf0ce('0x75')](_0x2b2b2e[_0x100b4a[_0x577ce8][_0xf0ce('0x73')]],'%s',_0x609d4d):_0x609d4d;_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x74')]?_[_0xf0ce('0x75')](_0x3fd7f9[_0x100b4a[_0x577ce8]['format']],'%s',_0x609d4d):_0x609d4d;if(_0x100b4a[_0x577ce8]['groupBy']){_0x5297d9[_0xf0ce('0x65')](_0x609d4d);}_0x100b4a[_0x577ce8]['orderBy']&&_0x5297d9[_0xf0ce('0x3a')](_0x609d4d,_0x100b4a[_0x577ce8][_0xf0ce('0x77')]===_0xf0ce('0x78')?![]:!![]);_0x5297d9[_0xf0ce('0x67')](_0x609d4d,_0x100b4a[_0x577ce8]['alias']||_0x609d4d);}if(_0x3fcdf0[_0xf0ce('0x79')]){_0x3fcdf0[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x3fcdf0['joins']);for(var _0x20cdda=0x0;_0x20cdda<_0x3fcdf0[_0xf0ce('0x79')][_0xf0ce('0x39')];_0x20cdda+=0x1){if(_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x2f')]&&_['includes'](_0x5adbf1,_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x2f')])&&_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7b')]&&_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7c')]&&_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x7d')]){_0x5297d9[_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda]['type']](_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda]['foreignTable'],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x3fcdf0[_0xf0ce('0x89')],_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x7b')],_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7c')],_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7d')]));}}}if(_0x3fcdf0['conditions']){_0x3fcdf0[_0xf0ce('0x7f')]=JSON[_0xf0ce('0x7a')](_0x3fcdf0[_0xf0ce('0x7f')]);_0x5297d9[_0xf0ce('0x3c')](_0x43d753(_0x3fcdf0[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x48fe42=_0x5297d9[_0xf0ce('0x9d')]();_0x5297d9[_0xf0ce('0x1f')](_0x4f02bc);_0x5297d9[_0xf0ce('0x21')](0x0);logger['debug']('Limited\x20Query:',_0x5297d9['toString']());return dbH[_0xf0ce('0x81')]['query'](_0x5297d9[_0xf0ce('0x94')](),{'type':dbH[_0xf0ce('0x81')][_0xf0ce('0x82')][_0xf0ce('0x83')]});}})[_0xf0ce('0x26')](function(){return{'sql':_0x48fe42['toString']()};})[_0xf0ce('0x26')](respondWithResult(_0x5d3210,null))[_0xf0ce('0x4e')](handleError(_0x5d3210,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 7682945..c783f5b 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 _0x8e65=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','util','../../config/logger','moment','bluebird'];(function(_0x80d2ee,_0x1f46d3){var _0x1b5e38=function(_0x50ab8b){while(--_0x50ab8b){_0x80d2ee['push'](_0x80d2ee['shift']());}};_0x1b5e38(++_0x1f46d3);}(_0x8e65,0x1a9));var _0x58e6=function(_0x388d0a,_0x3ed289){_0x388d0a=_0x388d0a-0x0;var _0x1b4cc4=_0x8e65[_0x388d0a];return _0x1b4cc4;};'use strict';var _=require('lodash');var util=require(_0x58e6('0x0'));var logger=require(_0x58e6('0x1'))('api');var moment=require(_0x58e6('0x2'));var BPromise=require(_0x58e6('0x3'));var rp=require(_0x58e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58e6('0x5'));var config=require(_0x58e6('0x6'));var attributes=require(_0x58e6('0x7'));module[_0x58e6('0x8')]=function(_0xc0a08e,_0x283c72){return _0xc0a08e[_0x58e6('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x58e6('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb28=['./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e2610,_0xe56978){var _0x4ce655=function(_0x325978){while(--_0x325978){_0x5e2610['push'](_0x5e2610['shift']());}};_0x4ce655(++_0xe56978);}(_0xeb28,0x9f));var _0x8eb2=function(_0x1748fd,_0x2c52a0){_0x1748fd=_0x1748fd-0x0;var _0x4575e8=_0xeb28[_0x1748fd];return _0x4575e8;};'use strict';var _=require(_0x8eb2('0x0'));var util=require(_0x8eb2('0x1'));var logger=require(_0x8eb2('0x2'))(_0x8eb2('0x3'));var moment=require(_0x8eb2('0x4'));var BPromise=require(_0x8eb2('0x5'));var rp=require(_0x8eb2('0x6'));var fs=require('fs');var path=require(_0x8eb2('0x7'));var rimraf=require(_0x8eb2('0x8'));var config=require('../../config/environment');var attributes=require(_0x8eb2('0x9'));module[_0x8eb2('0xa')]=function(_0x3f2d0b,_0x500a6){return _0x3f2d0b['define']('AnalyticCustomReport',attributes,{'tableName':_0x8eb2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 3cd82ea..34bdcd5 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 _0x49a0=['AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x59263b,_0x4d4ddd){var _0x41bed9=function(_0x30e91e){while(--_0x30e91e){_0x59263b['push'](_0x59263b['shift']());}};_0x41bed9(++_0x4d4ddd);}(_0x49a0,0x1ed));var _0x049a=function(_0x4ead23,_0x537fec){_0x4ead23=_0x4ead23-0x0;var _0x36bcae=_0x49a0[_0x4ead23];return _0x36bcae;};'use strict';var _=require(_0x049a('0x0'));var util=require(_0x049a('0x1'));var moment=require('moment');var BPromise=require(_0x049a('0x2'));var rs=require(_0x049a('0x3'));var fs=require('fs');var Redis=require(_0x049a('0x4'));var db=require(_0x049a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x049a('0x6'))(_0x049a('0x7'));var config=require('../../config/environment');var jayson=require(_0x049a('0x8'));var client=jayson['client'][_0x049a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdb0341,_0x38ed8c,_0x58a94c){return new BPromise(function(_0x557495,_0x307ddd){return client[_0x049a('0xa')](_0xdb0341,_0x58a94c)[_0x049a('0xb')](function(_0x1f79d8){logger[_0x049a('0xc')](_0x049a('0xd'),_0x38ed8c,'request\x20sent');logger[_0x049a('0xe')](_0x049a('0xf'),_0x38ed8c,_0x049a('0x10'),JSON[_0x049a('0x11')](_0x1f79d8));if(_0x1f79d8[_0x049a('0x12')]){if(_0x1f79d8[_0x049a('0x12')][_0x049a('0x13')]===0x1f4){logger[_0x049a('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x38ed8c,_0x1f79d8[_0x049a('0x12')][_0x049a('0x14')]);return _0x307ddd(_0x1f79d8[_0x049a('0x12')][_0x049a('0x14')]);}logger[_0x049a('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x38ed8c,_0x1f79d8['error'][_0x049a('0x14')]);return _0x557495(_0x1f79d8[_0x049a('0x12')][_0x049a('0x14')]);}else{logger['info'](_0x049a('0xd'),_0x38ed8c,_0x049a('0x10'));_0x557495(_0x1f79d8[_0x049a('0x15')]['message']);}})[_0x049a('0x16')](function(_0x4c6f59){logger[_0x049a('0x12')](_0x049a('0xd'),_0x38ed8c,_0x4c6f59);_0x307ddd(_0x4c6f59);});});}
\ No newline at end of file
+var _0xfa76=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2a815a,_0x46e71b){var _0x11296b=function(_0x392bc1){while(--_0x392bc1){_0x2a815a['push'](_0x2a815a['shift']());}};_0x11296b(++_0x46e71b);}(_0xfa76,0x18f));var _0x6fa7=function(_0x456a43,_0x471c3a){_0x456a43=_0x456a43-0x0;var _0xfe97de=_0xfa76[_0x456a43];return _0xfe97de;};'use strict';var _=require(_0x6fa7('0x0'));var util=require(_0x6fa7('0x1'));var moment=require(_0x6fa7('0x2'));var BPromise=require(_0x6fa7('0x3'));var rs=require(_0x6fa7('0x4'));var fs=require('fs');var Redis=require(_0x6fa7('0x5'));var db=require(_0x6fa7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fa7('0x7'))(_0x6fa7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6fa7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bcb54,_0x53ec8f,_0x2a6f50){return new BPromise(function(_0x503e1a,_0x5299db){return client[_0x6fa7('0xa')](_0x1bcb54,_0x2a6f50)[_0x6fa7('0xb')](function(_0x2f1cc5){logger[_0x6fa7('0xc')](_0x6fa7('0xd'),_0x53ec8f,_0x6fa7('0xe'));logger[_0x6fa7('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x53ec8f,'request\x20sent',JSON[_0x6fa7('0x10')](_0x2f1cc5));if(_0x2f1cc5[_0x6fa7('0x11')]){if(_0x2f1cc5['error'][_0x6fa7('0x12')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x53ec8f,_0x2f1cc5[_0x6fa7('0x11')][_0x6fa7('0x13')]);return _0x5299db(_0x2f1cc5['error'][_0x6fa7('0x13')]);}logger['error'](_0x6fa7('0xd'),_0x53ec8f,_0x2f1cc5[_0x6fa7('0x11')]['message']);return _0x503e1a(_0x2f1cc5[_0x6fa7('0x11')][_0x6fa7('0x13')]);}else{logger['info'](_0x6fa7('0xd'),_0x53ec8f,'request\x20sent');_0x503e1a(_0x2f1cc5[_0x6fa7('0x14')][_0x6fa7('0x13')]);}})[_0x6fa7('0x15')](function(_0x13bbb8){logger[_0x6fa7('0x11')](_0x6fa7('0xd'),_0x53ec8f,_0x13bbb8);_0x5299db(_0x13bbb8);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index db96fd6..acf268d 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 _0x248a=['/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run'];(function(_0xb47d1e,_0x1a306b){var _0x5180aa=function(_0x4d7294){while(--_0x4d7294){_0xb47d1e['push'](_0xb47d1e['shift']());}};_0x5180aa(++_0x1a306b);}(_0x248a,0x74));var _0xa248=function(_0x1021ea,_0x577e92){_0x1021ea=_0x1021ea-0x0;var _0x1b18ee=_0x248a[_0x1021ea];return _0x1b18ee;};'use strict';var multer=require(_0xa248('0x0'));var util=require(_0xa248('0x1'));var path=require(_0xa248('0x2'));var timeout=require(_0xa248('0x3'));var express=require(_0xa248('0x4'));var router=express[_0xa248('0x5')]();var fs_extra=require(_0xa248('0x6'));var auth=require(_0xa248('0x7'));var interaction=require(_0xa248('0x8'));var config=require(_0xa248('0x9'));var controller=require(_0xa248('0xa'));router['get']('/',auth[_0xa248('0xb')](),controller[_0xa248('0xc')]);router[_0xa248('0xd')](_0xa248('0xe'),auth[_0xa248('0xb')](),controller[_0xa248('0xf')]);router[_0xa248('0xd')](_0xa248('0x10'),auth[_0xa248('0xb')](),controller[_0xa248('0x11')]);router[_0xa248('0xd')](_0xa248('0x12'),auth[_0xa248('0xb')](),controller['run']);router[_0xa248('0xd')](_0xa248('0x13'),auth['isAuthenticated'](),controller[_0xa248('0x14')]);router[_0xa248('0x15')]('/',auth[_0xa248('0xb')](),controller[_0xa248('0x16')]);router[_0xa248('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xa248('0x18')]);router[_0xa248('0x19')](_0xa248('0xe'),auth[_0xa248('0xb')](),controller[_0xa248('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0xe93d=['query','post','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query'];(function(_0x315b9f,_0x5463c9){var _0x5c2907=function(_0x5607df){while(--_0x5607df){_0x315b9f['push'](_0x315b9f['shift']());}};_0x5c2907(++_0x5463c9);}(_0xe93d,0x1be));var _0xde93=function(_0xe2d486,_0x375089){_0xe2d486=_0xe2d486-0x0;var _0x414ffe=_0xe93d[_0xe2d486];return _0x414ffe;};'use strict';var multer=require(_0xde93('0x0'));var util=require(_0xde93('0x1'));var path=require('path');var timeout=require(_0xde93('0x2'));var express=require(_0xde93('0x3'));var router=express['Router']();var fs_extra=require(_0xde93('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde93('0x5'));var controller=require(_0xde93('0x6'));router[_0xde93('0x7')]('/',auth[_0xde93('0x8')](),controller['index']);router[_0xde93('0x7')](_0xde93('0x9'),auth['isAuthenticated'](),controller[_0xde93('0xa')]);router[_0xde93('0x7')](_0xde93('0xb'),auth[_0xde93('0x8')](),controller[_0xde93('0xc')]);router[_0xde93('0x7')](_0xde93('0xd'),auth[_0xde93('0x8')](),controller[_0xde93('0xe')]);router[_0xde93('0x7')](_0xde93('0xf'),auth[_0xde93('0x8')](),controller[_0xde93('0x10')]);router[_0xde93('0x11')]('/',auth[_0xde93('0x8')](),controller['create']);router[_0xde93('0x12')](_0xde93('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xde93('0x9'),auth['isAuthenticated'](),controller[_0xde93('0x13')]);module[_0xde93('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 43b021a..b0d41fd 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x4ca288,_0x254dd8){var _0x2362c1=function(_0x5504d8){while(--_0x5504d8){_0x4ca288['push'](_0x4ca288['shift']());}};_0x2362c1(++_0x254dd8);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x19cfac,_0x3745dc){_0x19cfac=_0x19cfac-0x0;var _0x25d2a5=_0xfdbd[_0x19cfac];return _0x25d2a5;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x35ebae,_0x4f86c4){var _0x1924cf=function(_0x5788fe){while(--_0x5788fe){_0x35ebae['push'](_0x35ebae['shift']());}};_0x1924cf(++_0x4f86c4);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x24ca[_0x2c0ded];return _0x4473e5;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 277ced9..409848d 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xabce[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
+var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0xfc84ed,_0x32ee8a){var _0xb5fba1=function(_0x1e3938){while(--_0x1e3938){_0xfc84ed['push'](_0xfc84ed['shift']());}};_0xb5fba1(++_0x32ee8a);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','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 _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index c3b7f48..5e6c9ad 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 _0x16d1=['analytics_default_reports','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport'];(function(_0x17727b,_0x16ac94){var _0x2c0c61=function(_0x1f1a82){while(--_0x1f1a82){_0x17727b['push'](_0x17727b['shift']());}};_0x2c0c61(++_0x16ac94);}(_0x16d1,0x15d));var _0x116d=function(_0x563739,_0x4b9199){_0x563739=_0x563739-0x0;var _0x1f326a=_0x16d1[_0x563739];return _0x1f326a;};'use strict';var _=require(_0x116d('0x0'));var util=require(_0x116d('0x1'));var logger=require('../../config/logger')(_0x116d('0x2'));var moment=require('moment');var BPromise=require(_0x116d('0x3'));var rp=require(_0x116d('0x4'));var fs=require('fs');var path=require(_0x116d('0x5'));var rimraf=require(_0x116d('0x6'));var config=require(_0x116d('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x116d('0x8')]=function(_0x437602,_0x2fd8ed){return _0x437602[_0x116d('0x9')](_0x116d('0xa'),attributes,{'tableName':_0x116d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61a3=['define','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1a5d29,_0x46f6cb){var _0x2b8467=function(_0x3ecee3){while(--_0x3ecee3){_0x1a5d29['push'](_0x1a5d29['shift']());}};_0x2b8467(++_0x46f6cb);}(_0x61a3,0x171));var _0x361a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61a3[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x361a('0x0'));var logger=require('../../config/logger')(_0x361a('0x1'));var moment=require(_0x361a('0x2'));var BPromise=require(_0x361a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x361a('0x4'));var rimraf=require(_0x361a('0x5'));var config=require(_0x361a('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x22b087,_0x7411c1){return _0x22b087[_0x361a('0x7')]('AnalyticDefaultReport',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 5c0bfbe..f4c94a0 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 _0x8a94=['../../config/logger','jayson/promise','client','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x1e9140,_0x44060d){var _0xf84e09=function(_0x257f57){while(--_0x257f57){_0x1e9140['push'](_0x1e9140['shift']());}};_0xf84e09(++_0x44060d);}(_0x8a94,0x13f));var _0x48a9=function(_0x576d65,_0x232150){_0x576d65=_0x576d65-0x0;var _0x5ba053=_0x8a94[_0x576d65];return _0x5ba053;};'use strict';var _=require(_0x48a9('0x0'));var util=require(_0x48a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x48a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x48a9('0x3'))['db'];var utils=require(_0x48a9('0x4'));var logger=require(_0x48a9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x48a9('0x6'));var client=jayson[_0x48a9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50b32e,_0x27da97,_0x329de5){return new BPromise(function(_0x1aa1c4,_0x5c2788){return client['request'](_0x50b32e,_0x329de5)[_0x48a9('0x8')](function(_0x44c7e7){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x27da97,_0x48a9('0x9'));logger[_0x48a9('0xa')](_0x48a9('0xb'),_0x27da97,_0x48a9('0x9'),JSON[_0x48a9('0xc')](_0x44c7e7));if(_0x44c7e7[_0x48a9('0xd')]){if(_0x44c7e7[_0x48a9('0xd')]['code']===0x1f4){logger[_0x48a9('0xd')](_0x48a9('0xe'),_0x27da97,_0x44c7e7[_0x48a9('0xd')]['message']);return _0x5c2788(_0x44c7e7[_0x48a9('0xd')][_0x48a9('0xf')]);}logger[_0x48a9('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x27da97,_0x44c7e7[_0x48a9('0xd')][_0x48a9('0xf')]);return _0x1aa1c4(_0x44c7e7[_0x48a9('0xd')][_0x48a9('0xf')]);}else{logger['info'](_0x48a9('0xe'),_0x27da97,_0x48a9('0x9'));_0x1aa1c4(_0x44c7e7[_0x48a9('0x10')]['message']);}})[_0x48a9('0x11')](function(_0x453c1c){logger[_0x48a9('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x27da97,_0x453c1c);_0x5c2788(_0x453c1c);});});}
\ No newline at end of file
+var _0x31d8=['../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2cb633,_0x5caee0){var _0x4b1a20=function(_0x4ea50f){while(--_0x4ea50f){_0x2cb633['push'](_0x2cb633['shift']());}};_0x4b1a20(++_0x5caee0);}(_0x31d8,0x1c7));var _0x831d=function(_0x3eda3d,_0x232089){_0x3eda3d=_0x3eda3d-0x0;var _0x2efe88=_0x31d8[_0x3eda3d];return _0x2efe88;};'use strict';var _=require('lodash');var util=require(_0x831d('0x0'));var moment=require(_0x831d('0x1'));var BPromise=require(_0x831d('0x2'));var rs=require(_0x831d('0x3'));var fs=require('fs');var Redis=require(_0x831d('0x4'));var db=require(_0x831d('0x5'))['db'];var utils=require(_0x831d('0x6'));var logger=require(_0x831d('0x7'))(_0x831d('0x8'));var config=require('../../config/environment');var jayson=require(_0x831d('0x9'));var client=jayson[_0x831d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254715,_0x361c11,_0xac8ca9){return new BPromise(function(_0x317125,_0x1a716f){return client[_0x831d('0xb')](_0x254715,_0xac8ca9)[_0x831d('0xc')](function(_0x4b4d6c){logger[_0x831d('0xd')](_0x831d('0xe'),_0x361c11,_0x831d('0xf'));logger[_0x831d('0x10')](_0x831d('0x11'),_0x361c11,_0x831d('0xf'),JSON[_0x831d('0x12')](_0x4b4d6c));if(_0x4b4d6c['error']){if(_0x4b4d6c[_0x831d('0x13')]['code']===0x1f4){logger[_0x831d('0x13')](_0x831d('0xe'),_0x361c11,_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);return _0x1a716f(_0x4b4d6c['error'][_0x831d('0x14')]);}logger['error'](_0x831d('0xe'),_0x361c11,_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);return _0x317125(_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);}else{logger[_0x831d('0xd')](_0x831d('0xe'),_0x361c11,'request\x20sent');_0x317125(_0x4b4d6c['result'][_0x831d('0x14')]);}})['catch'](function(_0x3eeb0d){logger[_0x831d('0x13')](_0x831d('0xe'),_0x361c11,_0x3eeb0d);_0x1a716f(_0x3eeb0d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 3f0dcf5..5e15ccb 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 _0x8c61=['Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','query','post','create','update','delete','multer','path','connect-timeout','express'];(function(_0x338805,_0x13788c){var _0x3f4f1f=function(_0xed0f6d){while(--_0xed0f6d){_0x338805['push'](_0x338805['shift']());}};_0x3f4f1f(++_0x13788c);}(_0x8c61,0x88));var _0x18c6=function(_0x282c51,_0x3b3fd5){_0x282c51=_0x282c51-0x0;var _0x4c54aa=_0x8c61[_0x282c51];return _0x4c54aa;};'use strict';var multer=require(_0x18c6('0x0'));var util=require('util');var path=require(_0x18c6('0x1'));var timeout=require(_0x18c6('0x2'));var express=require(_0x18c6('0x3'));var router=express[_0x18c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x18c6('0x5'));var config=require(_0x18c6('0x6'));var controller=require(_0x18c6('0x7'));router[_0x18c6('0x8')]('/',auth[_0x18c6('0x9')](),controller[_0x18c6('0xa')]);router[_0x18c6('0x8')](_0x18c6('0xb'),auth[_0x18c6('0x9')](),controller['show']);router[_0x18c6('0x8')](_0x18c6('0xc'),auth[_0x18c6('0x9')](),controller[_0x18c6('0xd')]);router['get'](_0x18c6('0xe'),auth[_0x18c6('0x9')](),controller['run']);router[_0x18c6('0x8')]('/:id/query',auth[_0x18c6('0x9')](),controller[_0x18c6('0xf')]);router[_0x18c6('0x10')]('/',auth[_0x18c6('0x9')](),controller[_0x18c6('0x11')]);router['put'](_0x18c6('0xb'),auth['isAuthenticated'](),controller[_0x18c6('0x12')]);router[_0x18c6('0x13')](_0x18c6('0xb'),auth[_0x18c6('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe55d=['Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/run','run','/:id/query','query','post','create','update','delete','/:id','destroy','exports','multer','connect-timeout','express'];(function(_0x3ba60c,_0x27b3a3){var _0x5de53d=function(_0x4b3396){while(--_0x4b3396){_0x3ba60c['push'](_0x3ba60c['shift']());}};_0x5de53d(++_0x27b3a3);}(_0xe55d,0x15d));var _0xde55=function(_0x4af6b8,_0x59f8a1){_0x4af6b8=_0x4af6b8-0x0;var _0x1b3b4b=_0xe55d[_0x4af6b8];return _0x1b3b4b;};'use strict';var multer=require(_0xde55('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xde55('0x1'));var express=require(_0xde55('0x2'));var router=express[_0xde55('0x3')]();var fs_extra=require(_0xde55('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xde55('0x5'));var config=require('../../config/environment');var controller=require(_0xde55('0x6'));router['get']('/',auth[_0xde55('0x7')](),controller[_0xde55('0x8')]);router[_0xde55('0x9')]('/:id',auth[_0xde55('0x7')](),controller[_0xde55('0xa')]);router[_0xde55('0x9')]('/:id/preview',auth[_0xde55('0x7')](),controller['preview']);router['get'](_0xde55('0xb'),auth[_0xde55('0x7')](),controller[_0xde55('0xc')]);router[_0xde55('0x9')](_0xde55('0xd'),auth[_0xde55('0x7')](),controller[_0xde55('0xe')]);router[_0xde55('0xf')]('/',auth[_0xde55('0x7')](),controller[_0xde55('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xde55('0x11')]);router[_0xde55('0x12')](_0xde55('0x13'),auth[_0xde55('0x7')](),controller[_0xde55('0x14')]);module[_0xde55('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 8f291d0..f55dbef 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 _0x6b26=['INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading','manual','scheduled'];(function(_0x5a2b99,_0x352dd7){var _0x167c87=function(_0xbd4900){while(--_0xbd4900){_0x5a2b99['push'](_0x5a2b99['shift']());}};_0x167c87(++_0x352dd7);}(_0x6b26,0x152));var _0x66b2=function(_0x3b9ffd,_0x9c8e5b){_0x3b9ffd=_0x3b9ffd-0x0;var _0x4bdb61=_0x6b26[_0x3b9ffd];return _0x4bdb61;};'use strict';var Sequelize=require(_0x66b2('0x0'));var moment=require(_0x66b2('0x1'));module[_0x66b2('0x2')]={'name':{'type':Sequelize[_0x66b2('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x66b2('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x66b2('0x4')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x66b2('0x5')},'savename':{'type':Sequelize[_0x66b2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x66b2('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x66b2('0x7')},'type':{'type':Sequelize['ENUM'](_0x66b2('0x8'),_0x66b2('0x9')),'allowNull':![],'defaultValue':_0x66b2('0x8')},'reportId':{'type':Sequelize[_0x66b2('0xa')](0xb)[_0x66b2('0xb')]},'reportType':{'type':Sequelize[_0x66b2('0x3')]}};
\ No newline at end of file
+var _0x63da=['ENUM','csv','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING'];(function(_0x4f72aa,_0x101b06){var _0x328dfe=function(_0x4bb1b5){while(--_0x4bb1b5){_0x4f72aa['push'](_0x4f72aa['shift']());}};_0x328dfe(++_0x101b06);}(_0x63da,0x1d6));var _0xa63d=function(_0x10d128,_0x1d80f6){_0x10d128=_0x10d128-0x0;var _0x52dc8a=_0x63da[_0x10d128];return _0x52dc8a;};'use strict';var Sequelize=require(_0xa63d('0x0'));var moment=require('moment');module[_0xa63d('0x1')]={'name':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xa63d('0x3')](_0xa63d('0x4'),'pdf',_0xa63d('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa63d('0x6')]},'endDate':{'type':Sequelize[_0xa63d('0x6')]},'status':{'type':Sequelize[_0xa63d('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xa63d('0x3')](_0xa63d('0x7'),_0xa63d('0x8')),'allowNull':![],'defaultValue':_0xa63d('0x7')},'reportId':{'type':Sequelize[_0xa63d('0x9')](0xb)[_0xa63d('0xa')]},'reportType':{'type':Sequelize[_0xa63d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 93814a5..7ac71b2 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 _0xc28f=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xd6b4a0,_0x1c4b83){var _0xd9048f=function(_0x926056){while(--_0x926056){_0xd6b4a0['push'](_0xd6b4a0['shift']());}};_0xd9048f(++_0x1c4b83);}(_0xc28f,0x109));var _0xfc28=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xc28f[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0xfc28('0x0'));var rimraf=require(_0xfc28('0x1'));var zipdir=require(_0xfc28('0x2'));var jsonpatch=require(_0xfc28('0x3'));var rp=require(_0xfc28('0x4'));var moment=require(_0xfc28('0x5'));var BPromise=require(_0xfc28('0x6'));var Mustache=require('mustache');var util=require(_0xfc28('0x7'));var path=require(_0xfc28('0x8'));var sox=require(_0xfc28('0x9'));var csv=require(_0xfc28('0xa'));var ejs=require(_0xfc28('0xb'));var fs=require('fs');var fs_extra=require(_0xfc28('0xc'));var _=require(_0xfc28('0xd'));var squel=require(_0xfc28('0xe'));var crypto=require(_0xfc28('0xf'));var jsforce=require(_0xfc28('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfc28('0xa'));var querystring=require(_0xfc28('0x11'));var Papa=require(_0xfc28('0x12'));var Redis=require(_0xfc28('0x13'));var authService=require(_0xfc28('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc28('0x15'));var logger=require(_0xfc28('0x16'))(_0xfc28('0x17'));var utils=require(_0xfc28('0x18'));var config=require(_0xfc28('0x19'));var licenseUtil=require(_0xfc28('0x1a'));var db=require(_0xfc28('0x1b'))['db'];function respondWithStatusCode(_0x475dfa,_0x392f46){_0x392f46=_0x392f46||0xcc;return function(_0x281146){if(_0x281146){return _0x475dfa[_0xfc28('0x1c')](_0x392f46);}return _0x475dfa['status'](_0x392f46)[_0xfc28('0x1d')]();};}function respondWithResult(_0x3c3ad9,_0x3678aa){_0x3678aa=_0x3678aa||0xc8;return function(_0x5336f7){if(_0x5336f7){return _0x3c3ad9[_0xfc28('0x1e')](_0x3678aa)[_0xfc28('0x1f')](_0x5336f7);}};}function respondWithFilteredResult(_0x59f8d5,_0x5144cb){return function(_0x4cd437){if(_0x4cd437){var _0x4ac0bc=typeof _0x5144cb[_0xfc28('0x20')]==='undefined'&&typeof _0x5144cb[_0xfc28('0x21')]===_0xfc28('0x22');var _0x254235=_0x4cd437[_0xfc28('0x23')];var _0x2a7014=_0x4ac0bc?0x0:_0x5144cb['offset'];var _0x3c5be0=_0x4ac0bc?_0x4cd437['count']:_0x5144cb['offset']+_0x5144cb[_0xfc28('0x21')];var _0x2b1220;if(_0x3c5be0>=_0x254235){_0x3c5be0=_0x254235;_0x2b1220=0xc8;}else{_0x2b1220=0xce;}_0x59f8d5[_0xfc28('0x1e')](_0x2b1220);return _0x59f8d5[_0xfc28('0x24')](_0xfc28('0x25'),_0x2a7014+'-'+_0x3c5be0+'/'+_0x254235)[_0xfc28('0x1f')](_0x4cd437);}return null;};}function patchUpdates(_0x32cf4a){return function(_0x2f9ce4){try{jsonpatch['apply'](_0x2f9ce4,_0x32cf4a,!![]);}catch(_0x3ba24c){return BPromise[_0xfc28('0x26')](_0x3ba24c);}return _0x2f9ce4[_0xfc28('0x27')]();};}function saveUpdates(_0x17d1e2,_0x245052){return function(_0x51e3dc){if(_0x51e3dc){return _0x51e3dc[_0xfc28('0x28')](_0x17d1e2)[_0xfc28('0x29')](function(_0x36d4af){return _0x36d4af;});}return null;};}function removeEntity(_0x3f7c28,_0x4d40f7){return function(_0x226c47){if(_0x226c47){return _0x226c47[_0xfc28('0x2a')]()[_0xfc28('0x29')](function(){var _0x1073f3=_0x226c47[_0xfc28('0x2b')]({'plain':!![]});var _0x4657cf=_0xfc28('0x2c');return db[_0xfc28('0x2d')][_0xfc28('0x2a')]({'where':{'type':_0x4657cf,'resourceId':_0x1073f3['id']}})[_0xfc28('0x29')](function(){return _0x226c47;});})['then'](function(){_0x3f7c28[_0xfc28('0x1e')](0xcc)[_0xfc28('0x1d')]();});}};}function handleEntityNotFound(_0x5a50a1,_0x3129ae){return function(_0x1c36e7){if(!_0x1c36e7){_0x5a50a1[_0xfc28('0x1c')](0x194);}return _0x1c36e7;};}function handleError(_0x3688f9,_0x159108){_0x159108=_0x159108||0x1f4;return function(_0x2514f3){logger[_0xfc28('0x2e')](_0x2514f3['stack']);if(_0x2514f3[_0xfc28('0x2f')]){delete _0x2514f3[_0xfc28('0x2f')];}_0x3688f9['status'](_0x159108)['send'](_0x2514f3);};}exports['index']=function(_0x365ecc,_0x5992b6){var _0x34cd29={},_0x133085={},_0x446e45={'count':0x0,'rows':[]};var _0x2b9ab5=_[_0xfc28('0x30')](db[_0xfc28('0x31')]['rawAttributes'],function(_0x1530f5){return{'name':_0x1530f5[_0xfc28('0x32')],'type':_0x1530f5[_0xfc28('0x33')][_0xfc28('0x34')]};});_0x133085[_0xfc28('0x35')]=_[_0xfc28('0x30')](_0x2b9ab5,_0xfc28('0x2f'));_0x133085[_0xfc28('0x36')]=_[_0xfc28('0x37')](_0x365ecc[_0xfc28('0x36')]);_0x133085[_0xfc28('0x38')]=_[_0xfc28('0x39')](_0x133085[_0xfc28('0x35')],_0x133085[_0xfc28('0x36')]);_0x34cd29[_0xfc28('0x3a')]=_[_0xfc28('0x39')](_0x133085['model'],qs[_0xfc28('0x3b')](_0x365ecc[_0xfc28('0x36')][_0xfc28('0x3b')]));_0x34cd29[_0xfc28('0x3a')]=_0x34cd29[_0xfc28('0x3a')][_0xfc28('0x3c')]?_0x34cd29[_0xfc28('0x3a')]:_0x133085['model'];if(!_0x365ecc[_0xfc28('0x36')]['hasOwnProperty'](_0xfc28('0x3d'))){_0x34cd29[_0xfc28('0x21')]=qs['limit'](_0x365ecc['query'][_0xfc28('0x21')]);_0x34cd29[_0xfc28('0x20')]=qs['offset'](_0x365ecc[_0xfc28('0x36')][_0xfc28('0x20')]);}_0x34cd29['order']=qs['sort'](_0x365ecc[_0xfc28('0x36')]['sort']);_0x34cd29[_0xfc28('0x3e')]=qs[_0xfc28('0x38')](_[_0xfc28('0x3f')](_0x365ecc[_0xfc28('0x36')],_0x133085[_0xfc28('0x38')]),_0x2b9ab5);if(_0x365ecc['query'][_0xfc28('0x40')]){_0x34cd29[_0xfc28('0x3e')]=_['merge'](_0x34cd29[_0xfc28('0x3e')],{'$or':_[_0xfc28('0x30')](_0x2b9ab5,function(_0x45c22a){if(_0x45c22a[_0xfc28('0x33')]!==_0xfc28('0x41')){var _0x4459cd={};_0x4459cd[_0x45c22a[_0xfc28('0x2f')]]={'$like':'%'+_0x365ecc[_0xfc28('0x36')]['filter']+'%'};return _0x4459cd;}})});}_0x34cd29=_[_0xfc28('0x42')]({},_0x34cd29,_0x365ecc[_0xfc28('0x43')]);var _0x4dd8eb={'where':_0x34cd29[_0xfc28('0x3e')]};return db[_0xfc28('0x31')][_0xfc28('0x23')](_0x4dd8eb)['then'](function(_0x461b55){_0x446e45['count']=_0x461b55;if(_0x365ecc[_0xfc28('0x36')]['includeAll']){_0x34cd29[_0xfc28('0x44')]=[{'all':!![]}];}return db[_0xfc28('0x31')][_0xfc28('0x45')](_0x34cd29);})[_0xfc28('0x29')](function(_0x96897b){_0x446e45[_0xfc28('0x46')]=_0x96897b;return _0x446e45;})[_0xfc28('0x29')](respondWithFilteredResult(_0x5992b6,_0x34cd29))['catch'](handleError(_0x5992b6,null));};exports['show']=function(_0x1a40e1,_0x11c315){var _0x1f21bf={'raw':!![],'where':{'id':_0x1a40e1[_0xfc28('0x47')]['id']}},_0x3cf1f0={};_0x3cf1f0[_0xfc28('0x35')]=_[_0xfc28('0x37')](db['AnalyticExtractedReport']['rawAttributes']);_0x3cf1f0['query']=_[_0xfc28('0x37')](_0x1a40e1[_0xfc28('0x36')]);_0x3cf1f0[_0xfc28('0x38')]=_['intersection'](_0x3cf1f0[_0xfc28('0x35')],_0x3cf1f0[_0xfc28('0x36')]);_0x1f21bf[_0xfc28('0x3a')]=_[_0xfc28('0x39')](_0x3cf1f0[_0xfc28('0x35')],qs['fields'](_0x1a40e1[_0xfc28('0x36')]['fields']));_0x1f21bf['attributes']=_0x1f21bf['attributes'][_0xfc28('0x3c')]?_0x1f21bf[_0xfc28('0x3a')]:_0x3cf1f0[_0xfc28('0x35')];if(_0x1a40e1['query'][_0xfc28('0x48')]){_0x1f21bf['include']=[{'all':!![]}];}_0x1f21bf=_['merge']({},_0x1f21bf,_0x1a40e1[_0xfc28('0x43')]);return db[_0xfc28('0x31')][_0xfc28('0x49')](_0x1f21bf)[_0xfc28('0x29')](handleEntityNotFound(_0x11c315,null))[_0xfc28('0x29')](respondWithResult(_0x11c315,null))['catch'](handleError(_0x11c315,null));};exports['create']=function(_0x475fbc,_0x420ade){return db[_0xfc28('0x31')][_0xfc28('0x4a')](_0x475fbc['body'],{})[_0xfc28('0x29')](function(_0x1ca9a6){var _0x486d61=_0x475fbc[_0xfc28('0x4b')]['get']({'plain':!![]});if(!_0x486d61)throw new Error(_0xfc28('0x4c'));if(_0x486d61['role']===_0xfc28('0x4b')){var _0x3d9d54=_0x1ca9a6[_0xfc28('0x2b')]({'plain':!![]});var _0x7dc80a=_0xfc28('0x2c');return db[_0xfc28('0x4d')]['find']({'where':{'name':_0x7dc80a,'userProfileId':_0x486d61[_0xfc28('0x4e')]},'raw':!![]})[_0xfc28('0x29')](function(_0x358a95){if(_0x358a95&&_0x358a95[_0xfc28('0x4f')]===0x0){return db[_0xfc28('0x2d')][_0xfc28('0x4a')]({'name':_0x3d9d54[_0xfc28('0x2f')],'resourceId':_0x3d9d54['id'],'type':_0x358a95['name'],'sectionId':_0x358a95['id']},{})['then'](function(){return _0x1ca9a6;});}else{return _0x1ca9a6;}})[_0xfc28('0x50')](function(_0x2a9543){logger[_0xfc28('0x2e')](_0xfc28('0x51'),_0x2a9543);throw _0x2a9543;});}return _0x1ca9a6;})['then'](respondWithResult(_0x420ade,0xc9))[_0xfc28('0x50')](handleError(_0x420ade,null));};exports['update']=function(_0x17e5cf,_0x59d51b){if(_0x17e5cf[_0xfc28('0x52')]['id']){delete _0x17e5cf[_0xfc28('0x52')]['id'];}return db[_0xfc28('0x31')][_0xfc28('0x49')]({'where':{'id':_0x17e5cf[_0xfc28('0x47')]['id']}})[_0xfc28('0x29')](handleEntityNotFound(_0x59d51b,null))[_0xfc28('0x29')](saveUpdates(_0x17e5cf[_0xfc28('0x52')],null))[_0xfc28('0x29')](respondWithResult(_0x59d51b,null))[_0xfc28('0x50')](handleError(_0x59d51b,null));};exports[_0xfc28('0x2a')]=function(_0x259e6e,_0xc228fb){return db[_0xfc28('0x31')][_0xfc28('0x49')]({'where':{'id':_0x259e6e['params']['id']}})[_0xfc28('0x29')](handleEntityNotFound(_0xc228fb,null))['then'](removeEntity(_0xc228fb,null))[_0xfc28('0x50')](handleError(_0xc228fb,null));};exports[_0xfc28('0x53')]=function(_0x3c99ff,_0x108c99,_0x54fdb6){return db[_0xfc28('0x31')][_0xfc28('0x49')]({'where':{'id':_0x3c99ff['params']['id']},'attributes':['name',_0xfc28('0x54'),_0xfc28('0x55'),_0xfc28('0x56')],'raw':!![]})[_0xfc28('0x29')](handleEntityNotFound(_0x108c99,null))[_0xfc28('0x29')](function(_0x4d6d2a){if(_0x4d6d2a){if(!fs[_0xfc28('0x57')](path[_0xfc28('0x58')](config[_0xfc28('0x59')],_0xfc28('0x5a'),_0x4d6d2a['savename']))){throw new db[(_0xfc28('0x5b'))][(_0xfc28('0x5c'))](_0xfc28('0x5d'));}if(_0x3c99ff[_0xfc28('0x36')][_0xfc28('0x5e')]){return _0x108c99[_0xfc28('0x1c')](0xc8);}return _0x108c99[_0xfc28('0x53')](path[_0xfc28('0x58')](config[_0xfc28('0x59')],_0xfc28('0x5a'),_0x4d6d2a[_0xfc28('0x55')]),util['format'](_0xfc28('0x5f'),_0x4d6d2a[_0xfc28('0x54')]||_0x4d6d2a[_0xfc28('0x2f')],_0x4d6d2a[_0xfc28('0x56')][_0xfc28('0x60')]()));}})[_0xfc28('0x50')](handleError(_0x108c99,null));};
\ No newline at end of file
+var _0x868c=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','basename','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','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/license/util','sendStatus','end','status','json','undefined','count','limit','set','Content-Range','apply','save','then','UserProfileResource','error','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x868c,0x6a));var _0xc868=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x868c[_0x2c7b86];return _0x256735;};'use strict';var emlformat=require(_0xc868('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc868('0x1'));var jsonpatch=require(_0xc868('0x2'));var rp=require(_0xc868('0x3'));var moment=require(_0xc868('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc868('0x5'));var util=require('util');var path=require(_0xc868('0x6'));var sox=require('sox');var csv=require(_0xc868('0x7'));var ejs=require(_0xc868('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc868('0x9'));var squel=require(_0xc868('0xa'));var crypto=require(_0xc868('0xb'));var jsforce=require(_0xc868('0xc'));var deskjs=require(_0xc868('0xd'));var toCsv=require(_0xc868('0x7'));var querystring=require(_0xc868('0xe'));var Papa=require('papaparse');var Redis=require(_0xc868('0xf'));var authService=require(_0xc868('0x10'));var qs=require(_0xc868('0x11'));var as=require(_0xc868('0x12'));var hardwareService=require(_0xc868('0x13'));var logger=require(_0xc868('0x14'))(_0xc868('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc868('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d8701,_0x390945){_0x390945=_0x390945||0xcc;return function(_0x2a10a3){if(_0x2a10a3){return _0x5d8701[_0xc868('0x17')](_0x390945);}return _0x5d8701['status'](_0x390945)[_0xc868('0x18')]();};}function respondWithResult(_0x28249e,_0x43d366){_0x43d366=_0x43d366||0xc8;return function(_0x427f2a){if(_0x427f2a){return _0x28249e[_0xc868('0x19')](_0x43d366)[_0xc868('0x1a')](_0x427f2a);}};}function respondWithFilteredResult(_0x5cacf3,_0xb18435){return function(_0x5d3241){if(_0x5d3241){var _0x2d6704=typeof _0xb18435['offset']===_0xc868('0x1b')&&typeof _0xb18435['limit']===_0xc868('0x1b');var _0x13c72a=_0x5d3241[_0xc868('0x1c')];var _0x2d3930=_0x2d6704?0x0:_0xb18435['offset'];var _0x3f823d=_0x2d6704?_0x5d3241[_0xc868('0x1c')]:_0xb18435['offset']+_0xb18435[_0xc868('0x1d')];var _0x4d279f;if(_0x3f823d>=_0x13c72a){_0x3f823d=_0x13c72a;_0x4d279f=0xc8;}else{_0x4d279f=0xce;}_0x5cacf3['status'](_0x4d279f);return _0x5cacf3[_0xc868('0x1e')](_0xc868('0x1f'),_0x2d3930+'-'+_0x3f823d+'/'+_0x13c72a)[_0xc868('0x1a')](_0x5d3241);}return null;};}function patchUpdates(_0x1a40b3){return function(_0x35021){try{jsonpatch[_0xc868('0x20')](_0x35021,_0x1a40b3,!![]);}catch(_0x1219a0){return BPromise['reject'](_0x1219a0);}return _0x35021[_0xc868('0x21')]();};}function saveUpdates(_0x5b6ad8,_0x2f356c){return function(_0x2764dc){if(_0x2764dc){return _0x2764dc['update'](_0x5b6ad8)[_0xc868('0x22')](function(_0x3756f7){return _0x3756f7;});}return null;};}function removeEntity(_0x5cad42,_0x248be9){return function(_0x4ac71f){if(_0x4ac71f){return _0x4ac71f['destroy']()[_0xc868('0x22')](function(){var _0x42f85d=_0x4ac71f['get']({'plain':!![]});var _0xa5acf='ExtractedReports';return db[_0xc868('0x23')]['destroy']({'where':{'type':_0xa5acf,'resourceId':_0x42f85d['id']}})[_0xc868('0x22')](function(){return _0x4ac71f;});})[_0xc868('0x22')](function(){_0x5cad42['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fbedb,_0x4c0fb7){return function(_0x54bcda){if(!_0x54bcda){_0x2fbedb['sendStatus'](0x194);}return _0x54bcda;};}function handleError(_0x453d84,_0x4d94ab){_0x4d94ab=_0x4d94ab||0x1f4;return function(_0x555507){logger[_0xc868('0x24')](_0x555507['stack']);if(_0x555507[_0xc868('0x25')]){delete _0x555507[_0xc868('0x25')];}_0x453d84[_0xc868('0x19')](_0x4d94ab)['send'](_0x555507);};}exports[_0xc868('0x26')]=function(_0x212539,_0x1014d5){var _0x5b3ee3={},_0x389522={},_0xb5a86f={'count':0x0,'rows':[]};var _0x24cde4=_[_0xc868('0x27')](db[_0xc868('0x28')][_0xc868('0x29')],function(_0x2eeb1a){return{'name':_0x2eeb1a[_0xc868('0x2a')],'type':_0x2eeb1a['type'][_0xc868('0x2b')]};});_0x389522['model']=_['map'](_0x24cde4,_0xc868('0x25'));_0x389522[_0xc868('0x2c')]=_['keys'](_0x212539[_0xc868('0x2c')]);_0x389522[_0xc868('0x2d')]=_[_0xc868('0x2e')](_0x389522[_0xc868('0x2f')],_0x389522[_0xc868('0x2c')]);_0x5b3ee3[_0xc868('0x30')]=_['intersection'](_0x389522[_0xc868('0x2f')],qs['fields'](_0x212539[_0xc868('0x2c')][_0xc868('0x31')]));_0x5b3ee3[_0xc868('0x30')]=_0x5b3ee3[_0xc868('0x30')][_0xc868('0x32')]?_0x5b3ee3[_0xc868('0x30')]:_0x389522[_0xc868('0x2f')];if(!_0x212539[_0xc868('0x2c')]['hasOwnProperty'](_0xc868('0x33'))){_0x5b3ee3[_0xc868('0x1d')]=qs[_0xc868('0x1d')](_0x212539['query'][_0xc868('0x1d')]);_0x5b3ee3[_0xc868('0x34')]=qs[_0xc868('0x34')](_0x212539[_0xc868('0x2c')]['offset']);}_0x5b3ee3[_0xc868('0x35')]=qs[_0xc868('0x36')](_0x212539[_0xc868('0x2c')][_0xc868('0x36')]);_0x5b3ee3[_0xc868('0x37')]=qs['filters'](_[_0xc868('0x38')](_0x212539[_0xc868('0x2c')],_0x389522[_0xc868('0x2d')]),_0x24cde4);if(_0x212539['query']['filter']){_0x5b3ee3[_0xc868('0x37')]=_[_0xc868('0x39')](_0x5b3ee3['where'],{'$or':_[_0xc868('0x27')](_0x24cde4,function(_0x4064fa){if(_0x4064fa['type']!=='VIRTUAL'){var _0x50625e={};_0x50625e[_0x4064fa[_0xc868('0x25')]]={'$like':'%'+_0x212539[_0xc868('0x2c')][_0xc868('0x3a')]+'%'};return _0x50625e;}})});}_0x5b3ee3=_['merge']({},_0x5b3ee3,_0x212539[_0xc868('0x3b')]);var _0x5e2edc={'where':_0x5b3ee3['where']};return db['AnalyticExtractedReport']['count'](_0x5e2edc)[_0xc868('0x22')](function(_0x43612b){_0xb5a86f[_0xc868('0x1c')]=_0x43612b;if(_0x212539['query']['includeAll']){_0x5b3ee3[_0xc868('0x3c')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xc868('0x3d')](_0x5b3ee3);})[_0xc868('0x22')](function(_0x5e515a){_0xb5a86f[_0xc868('0x3e')]=_0x5e515a;return _0xb5a86f;})[_0xc868('0x22')](respondWithFilteredResult(_0x1014d5,_0x5b3ee3))[_0xc868('0x3f')](handleError(_0x1014d5,null));};exports['show']=function(_0x85ce5c,_0x575ce4){var _0x30f4b5={'raw':!![],'where':{'id':_0x85ce5c[_0xc868('0x40')]['id']}},_0x94c26d={};_0x94c26d[_0xc868('0x2f')]=_[_0xc868('0x41')](db[_0xc868('0x28')][_0xc868('0x29')]);_0x94c26d[_0xc868('0x2c')]=_[_0xc868('0x41')](_0x85ce5c[_0xc868('0x2c')]);_0x94c26d['filters']=_[_0xc868('0x2e')](_0x94c26d[_0xc868('0x2f')],_0x94c26d[_0xc868('0x2c')]);_0x30f4b5['attributes']=_[_0xc868('0x2e')](_0x94c26d['model'],qs[_0xc868('0x31')](_0x85ce5c[_0xc868('0x2c')][_0xc868('0x31')]));_0x30f4b5['attributes']=_0x30f4b5[_0xc868('0x30')][_0xc868('0x32')]?_0x30f4b5['attributes']:_0x94c26d[_0xc868('0x2f')];if(_0x85ce5c[_0xc868('0x2c')][_0xc868('0x42')]){_0x30f4b5[_0xc868('0x3c')]=[{'all':!![]}];}_0x30f4b5=_[_0xc868('0x39')]({},_0x30f4b5,_0x85ce5c[_0xc868('0x3b')]);return db[_0xc868('0x28')][_0xc868('0x43')](_0x30f4b5)[_0xc868('0x22')](handleEntityNotFound(_0x575ce4,null))[_0xc868('0x22')](respondWithResult(_0x575ce4,null))[_0xc868('0x3f')](handleError(_0x575ce4,null));};exports[_0xc868('0x44')]=function(_0xcf461b,_0x358d09){return db[_0xc868('0x28')]['create'](_0xcf461b[_0xc868('0x45')],{})[_0xc868('0x22')](function(_0x6f74ae){var _0x2bcd86=_0xcf461b[_0xc868('0x46')]['get']({'plain':!![]});if(!_0x2bcd86)throw new Error(_0xc868('0x47'));if(_0x2bcd86['role']===_0xc868('0x46')){var _0x4f8291=_0x6f74ae['get']({'plain':!![]});var _0x194185=_0xc868('0x48');return db[_0xc868('0x49')][_0xc868('0x43')]({'where':{'name':_0x194185,'userProfileId':_0x2bcd86[_0xc868('0x4a')]},'raw':!![]})[_0xc868('0x22')](function(_0x3d7d7d){if(_0x3d7d7d&&_0x3d7d7d['autoAssociation']===0x0){return db['UserProfileResource'][_0xc868('0x44')]({'name':_0x4f8291['name'],'resourceId':_0x4f8291['id'],'type':_0x3d7d7d[_0xc868('0x25')],'sectionId':_0x3d7d7d['id']},{})[_0xc868('0x22')](function(){return _0x6f74ae;});}else{return _0x6f74ae;}})[_0xc868('0x3f')](function(_0x30ecc9){logger['error'](_0xc868('0x4b'),_0x30ecc9);throw _0x30ecc9;});}return _0x6f74ae;})['then'](respondWithResult(_0x358d09,0xc9))[_0xc868('0x3f')](handleError(_0x358d09,null));};exports[_0xc868('0x4c')]=function(_0x49563e,_0x2fe358){if(_0x49563e[_0xc868('0x45')]['id']){delete _0x49563e[_0xc868('0x45')]['id'];}return db['AnalyticExtractedReport'][_0xc868('0x43')]({'where':{'id':_0x49563e[_0xc868('0x40')]['id']}})['then'](handleEntityNotFound(_0x2fe358,null))[_0xc868('0x22')](saveUpdates(_0x49563e[_0xc868('0x45')],null))['then'](respondWithResult(_0x2fe358,null))[_0xc868('0x3f')](handleError(_0x2fe358,null));};exports['destroy']=function(_0x3d4acd,_0x365642){return db[_0xc868('0x28')][_0xc868('0x43')]({'where':{'id':_0x3d4acd[_0xc868('0x40')]['id']}})[_0xc868('0x22')](handleEntityNotFound(_0x365642,null))[_0xc868('0x22')](removeEntity(_0x365642,null))[_0xc868('0x3f')](handleError(_0x365642,null));};exports['download']=function(_0x4aaf7e,_0x2a1155,_0x2505ab){return db[_0xc868('0x28')][_0xc868('0x43')]({'where':{'id':_0x4aaf7e[_0xc868('0x40')]['id']},'attributes':['name','basename',_0xc868('0x4d'),_0xc868('0x4e')],'raw':!![]})[_0xc868('0x22')](handleEntityNotFound(_0x2a1155,null))[_0xc868('0x22')](function(_0x357364){if(_0x357364){if(!fs[_0xc868('0x4f')](path[_0xc868('0x50')](config[_0xc868('0x51')],_0xc868('0x52'),_0x357364[_0xc868('0x4d')]))){throw new db[(_0xc868('0x53'))][(_0xc868('0x54'))](_0xc868('0x55'));}if(_0x4aaf7e['query'][_0xc868('0x56')]){return _0x2a1155['sendStatus'](0xc8);}return _0x2a1155['download'](path[_0xc868('0x50')](config[_0xc868('0x51')],_0xc868('0x52'),_0x357364[_0xc868('0x4d')]),util['format'](_0xc868('0x57'),_0x357364[_0xc868('0x58')]||_0x357364['name'],_0x357364[_0xc868('0x4e')][_0xc868('0x59')]()));}})[_0xc868('0x3f')](handleError(_0x2a1155,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index e24b4dd..aaec26e 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 _0xe912=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x5dc755,_0x3254d0){var _0x24ce81=function(_0x3c8315){while(--_0x3c8315){_0x5dc755['push'](_0x5dc755['shift']());}};_0x24ce81(++_0x3254d0);}(_0xe912,0xb5));var _0x2e91=function(_0x5e9f46,_0x4967c9){_0x5e9f46=_0x5e9f46-0x0;var _0x3ad20c=_0xe912[_0x5e9f46];return _0x3ad20c;};'use strict';var _=require(_0x2e91('0x0'));var util=require(_0x2e91('0x1'));var logger=require(_0x2e91('0x2'))(_0x2e91('0x3'));var moment=require(_0x2e91('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e91('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e91('0x6'));var config=require(_0x2e91('0x7'));var attributes=require(_0x2e91('0x8'));module[_0x2e91('0x9')]=function(_0x2a7583,_0x29080e){return _0x2a7583[_0x2e91('0xa')](_0x2e91('0xb'),attributes,{'tableName':_0x2e91('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38c8=['api','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0xd9a887,_0x51bfb3){var _0x331b9f=function(_0x22f5bb){while(--_0x22f5bb){_0xd9a887['push'](_0xd9a887['shift']());}};_0x331b9f(++_0x51bfb3);}(_0x38c8,0x1e2));var _0x838c=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x38c8[_0x4667b2];return _0x1070f2;};'use strict';var _=require(_0x838c('0x0'));var util=require(_0x838c('0x1'));var logger=require('../../config/logger')(_0x838c('0x2'));var moment=require('moment');var BPromise=require(_0x838c('0x3'));var rp=require(_0x838c('0x4'));var fs=require('fs');var path=require(_0x838c('0x5'));var rimraf=require(_0x838c('0x6'));var config=require('../../config/environment');var attributes=require(_0x838c('0x7'));module[_0x838c('0x8')]=function(_0x5bb480,_0xc948ca){return _0x5bb480[_0x838c('0x9')](_0x838c('0xa'),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 6655d4b..4f1b630 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 _0x3bc4=['error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code'];(function(_0x3b2191,_0x13dba7){var _0x2c6233=function(_0x1247fb){while(--_0x1247fb){_0x3b2191['push'](_0x3b2191['shift']());}};_0x2c6233(++_0x13dba7);}(_0x3bc4,0xc9));var _0x43bc=function(_0x41930d,_0x478ed3){_0x41930d=_0x41930d-0x0;var _0x455ade=_0x3bc4[_0x41930d];return _0x455ade;};'use strict';var _=require('lodash');var util=require(_0x43bc('0x0'));var moment=require(_0x43bc('0x1'));var BPromise=require(_0x43bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43bc('0x3'));var db=require(_0x43bc('0x4'))['db'];var utils=require(_0x43bc('0x5'));var logger=require(_0x43bc('0x6'))(_0x43bc('0x7'));var config=require(_0x43bc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x43bc('0x9')][_0x43bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3037ba,_0x2cb9a8,_0x22a9fc){return new BPromise(function(_0x3926a4,_0x18cdef){return client[_0x43bc('0xb')](_0x3037ba,_0x22a9fc)[_0x43bc('0xc')](function(_0x1088d9){logger[_0x43bc('0xd')](_0x43bc('0xe'),_0x2cb9a8,'request\x20sent');logger['debug'](_0x43bc('0xf'),_0x2cb9a8,_0x43bc('0x10'),JSON[_0x43bc('0x11')](_0x1088d9));if(_0x1088d9['error']){if(_0x1088d9['error'][_0x43bc('0x12')]===0x1f4){logger[_0x43bc('0x13')](_0x43bc('0xe'),_0x2cb9a8,_0x1088d9[_0x43bc('0x13')][_0x43bc('0x14')]);return _0x18cdef(_0x1088d9[_0x43bc('0x13')][_0x43bc('0x14')]);}logger[_0x43bc('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2cb9a8,_0x1088d9['error'][_0x43bc('0x14')]);return _0x3926a4(_0x1088d9[_0x43bc('0x13')][_0x43bc('0x14')]);}else{logger[_0x43bc('0xd')](_0x43bc('0xe'),_0x2cb9a8,_0x43bc('0x10'));_0x3926a4(_0x1088d9['result'][_0x43bc('0x14')]);}})[_0x43bc('0x15')](function(_0x17e0e0){logger[_0x43bc('0x13')](_0x43bc('0xe'),_0x2cb9a8,_0x17e0e0);_0x18cdef(_0x17e0e0);});});}
\ No newline at end of file
+var _0x0f7f=['result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x26df46,_0x5badde){var _0x1722bf=function(_0x38d7cf){while(--_0x38d7cf){_0x26df46['push'](_0x26df46['shift']());}};_0x1722bf(++_0x5badde);}(_0x0f7f,0x1cf));var _0xf0f7=function(_0x1156e1,_0x1844bc){_0x1156e1=_0x1156e1-0x0;var _0x18969e=_0x0f7f[_0x1156e1];return _0x18969e;};'use strict';var _=require(_0xf0f7('0x0'));var util=require('util');var moment=require(_0xf0f7('0x1'));var BPromise=require('bluebird');var rs=require(_0xf0f7('0x2'));var fs=require('fs');var Redis=require(_0xf0f7('0x3'));var db=require(_0xf0f7('0x4'))['db'];var utils=require(_0xf0f7('0x5'));var logger=require('../../config/logger')(_0xf0f7('0x6'));var config=require(_0xf0f7('0x7'));var jayson=require(_0xf0f7('0x8'));var client=jayson[_0xf0f7('0x9')][_0xf0f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56c01b,_0x165652,_0x47835a){return new BPromise(function(_0x413ea3,_0x22ba33){return client[_0xf0f7('0xb')](_0x56c01b,_0x47835a)[_0xf0f7('0xc')](function(_0x2d2473){logger['info'](_0xf0f7('0xd'),_0x165652,_0xf0f7('0xe'));logger[_0xf0f7('0xf')](_0xf0f7('0x10'),_0x165652,_0xf0f7('0xe'),JSON['stringify'](_0x2d2473));if(_0x2d2473[_0xf0f7('0x11')]){if(_0x2d2473['error'][_0xf0f7('0x12')]===0x1f4){logger[_0xf0f7('0x11')](_0xf0f7('0xd'),_0x165652,_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);return _0x22ba33(_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);}logger['error'](_0xf0f7('0xd'),_0x165652,_0x2d2473['error'][_0xf0f7('0x13')]);return _0x413ea3(_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);}else{logger[_0xf0f7('0x14')](_0xf0f7('0xd'),_0x165652,_0xf0f7('0xe'));_0x413ea3(_0x2d2473[_0xf0f7('0x15')]['message']);}})['catch'](function(_0x2c14c8){logger[_0xf0f7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x165652,_0x2c14c8);_0x22ba33(_0x2c14c8);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 0c496cb..8ba2f7d 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 _0xd12f=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','put','delete','destroy','multer','util','express','fs-extra'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xd12f,0x13f));var _0xfd12=function(_0x20261c,_0x215fa9){_0x20261c=_0x20261c-0x0;var _0x44b50=_0xd12f[_0x20261c];return _0x44b50;};'use strict';var multer=require(_0xfd12('0x0'));var util=require(_0xfd12('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfd12('0x2'));var router=express['Router']();var fs_extra=require(_0xfd12('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd12('0x4'));var config=require(_0xfd12('0x5'));var controller=require(_0xfd12('0x6'));router[_0xfd12('0x7')]('/',auth[_0xfd12('0x8')](),controller[_0xfd12('0x9')]);router[_0xfd12('0x7')](_0xfd12('0xa'),auth['isAuthenticated'](),controller[_0xfd12('0xb')]);router[_0xfd12('0x7')](_0xfd12('0xc'),auth[_0xfd12('0x8')](),controller[_0xfd12('0xd')]);router['post']('/',auth[_0xfd12('0x8')](),controller['create']);router[_0xfd12('0xe')](_0xfd12('0xa'),auth[_0xfd12('0x8')](),controller['update']);router[_0xfd12('0xf')](_0xfd12('0xa'),auth[_0xfd12('0x8')](),controller[_0xfd12('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xa197=['show','/:id/download','download','post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id'];(function(_0x1302ef,_0x57e326){var _0x5f3c4e=function(_0x4ca663){while(--_0x4ca663){_0x1302ef['push'](_0x1302ef['shift']());}};_0x5f3c4e(++_0x57e326);}(_0xa197,0x8c));var _0x7a19=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xa197[_0x519756];return _0x37047e;};'use strict';var multer=require(_0x7a19('0x0'));var util=require(_0x7a19('0x1'));var path=require(_0x7a19('0x2'));var timeout=require(_0x7a19('0x3'));var express=require('express');var router=express[_0x7a19('0x4')]();var fs_extra=require(_0x7a19('0x5'));var auth=require(_0x7a19('0x6'));var interaction=require(_0x7a19('0x7'));var config=require(_0x7a19('0x8'));var controller=require(_0x7a19('0x9'));router[_0x7a19('0xa')]('/',auth[_0x7a19('0xb')](),controller[_0x7a19('0xc')]);router[_0x7a19('0xa')](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller[_0x7a19('0xe')]);router[_0x7a19('0xa')](_0x7a19('0xf'),auth[_0x7a19('0xb')](),controller[_0x7a19('0x10')]);router[_0x7a19('0x11')]('/',auth[_0x7a19('0xb')](),controller[_0x7a19('0x12')]);router['put'](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller[_0x7a19('0x13')]);router[_0x7a19('0x14')](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller['destroy']);module[_0x7a19('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e7d7fa1..6b1412c 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 _0x4cf5=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x4cf5,0x17f));var _0x54cf=function(_0x44f1d6,_0x1f9336){_0x44f1d6=_0x44f1d6-0x0;var _0x49a030=_0x4cf5[_0x44f1d6];return _0x49a030;};'use strict';var Sequelize=require(_0x54cf('0x0'));module['exports']={'field':{'type':Sequelize[_0x54cf('0x1')]},'alias':{'type':Sequelize[_0x54cf('0x2')]},'function':{'type':Sequelize[_0x54cf('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x54cf('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x54cf('0x2')]},'custom':{'type':Sequelize[_0x54cf('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfe1f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x366e75,_0x533d1d){var _0x3b167b=function(_0x3e9f1d){while(--_0x3e9f1d){_0x366e75['push'](_0x366e75['shift']());}};_0x3b167b(++_0x533d1d);}(_0xfe1f,0x97));var _0xffe1=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0xfe1f[_0x295143];return _0x7982e4;};'use strict';var Sequelize=require(_0xffe1('0x0'));module[_0xffe1('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xffe1('0x2')]},'groupBy':{'type':Sequelize[_0xffe1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xffe1('0x2')]},'custom':{'type':Sequelize[_0xffe1('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 9b33b84..4d548e3 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 _0x5937=['pick','filter','where','merge','type','VIRTUAL','AnalyticFieldReport','include','findAll','rows','show','params','keys','filters','intersection','fields','includeAll','options','find','catch','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x31417e,_0x424f9a){var _0x3a7cee=function(_0x6024fd){while(--_0x6024fd){_0x31417e['push'](_0x31417e['shift']());}};_0x3a7cee(++_0x424f9a);}(_0x5937,0x1c3));var _0x7593=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5937[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x7593('0x0'));var rimraf=require(_0x7593('0x1'));var zipdir=require(_0x7593('0x2'));var jsonpatch=require(_0x7593('0x3'));var rp=require('request-promise');var moment=require(_0x7593('0x4'));var BPromise=require(_0x7593('0x5'));var Mustache=require('mustache');var util=require(_0x7593('0x6'));var path=require('path');var sox=require(_0x7593('0x7'));var csv=require(_0x7593('0x8'));var ejs=require(_0x7593('0x9'));var fs=require('fs');var fs_extra=require(_0x7593('0xa'));var _=require('lodash');var squel=require(_0x7593('0xb'));var crypto=require(_0x7593('0xc'));var jsforce=require(_0x7593('0xd'));var deskjs=require(_0x7593('0xe'));var toCsv=require(_0x7593('0x8'));var querystring=require(_0x7593('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7593('0x10'));var qs=require(_0x7593('0x11'));var as=require(_0x7593('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7593('0x13'))(_0x7593('0x14'));var utils=require('../../config/utils');var config=require(_0x7593('0x15'));var licenseUtil=require(_0x7593('0x16'));var db=require(_0x7593('0x17'))['db'];function respondWithStatusCode(_0x9bf4b7,_0x187f40){_0x187f40=_0x187f40||0xcc;return function(_0x18a1f0){if(_0x18a1f0){return _0x9bf4b7[_0x7593('0x18')](_0x187f40);}return _0x9bf4b7['status'](_0x187f40)['end']();};}function respondWithResult(_0x483def,_0x27e0aa){_0x27e0aa=_0x27e0aa||0xc8;return function(_0x4e2a2e){if(_0x4e2a2e){return _0x483def[_0x7593('0x19')](_0x27e0aa)[_0x7593('0x1a')](_0x4e2a2e);}};}function respondWithFilteredResult(_0x3ede67,_0x12718b){return function(_0x36746b){if(_0x36746b){var _0x5a1ede=typeof _0x12718b[_0x7593('0x1b')]===_0x7593('0x1c')&&typeof _0x12718b['limit']==='undefined';var _0x556d06=_0x36746b[_0x7593('0x1d')];var _0x549969=_0x5a1ede?0x0:_0x12718b[_0x7593('0x1b')];var _0x554b75=_0x5a1ede?_0x36746b['count']:_0x12718b[_0x7593('0x1b')]+_0x12718b[_0x7593('0x1e')];var _0x2ec661;if(_0x554b75>=_0x556d06){_0x554b75=_0x556d06;_0x2ec661=0xc8;}else{_0x2ec661=0xce;}_0x3ede67['status'](_0x2ec661);return _0x3ede67['set'](_0x7593('0x1f'),_0x549969+'-'+_0x554b75+'/'+_0x556d06)[_0x7593('0x1a')](_0x36746b);}return null;};}function patchUpdates(_0x26369f){return function(_0x62e291){try{jsonpatch[_0x7593('0x20')](_0x62e291,_0x26369f,!![]);}catch(_0x5c2dac){return BPromise[_0x7593('0x21')](_0x5c2dac);}return _0x62e291['save']();};}function saveUpdates(_0x9fc481,_0x5206a3){return function(_0x25d6c1){if(_0x25d6c1){return _0x25d6c1[_0x7593('0x22')](_0x9fc481)[_0x7593('0x23')](function(_0x41cee8){return _0x41cee8;});}return null;};}function removeEntity(_0x266055,_0x12ae02){return function(_0x3e911f){if(_0x3e911f){return _0x3e911f[_0x7593('0x24')]()['then'](function(){_0x266055[_0x7593('0x19')](0xcc)[_0x7593('0x25')]();});}};}function handleEntityNotFound(_0x19106a,_0x57066a){return function(_0x3ee81d){if(!_0x3ee81d){_0x19106a['sendStatus'](0x194);}return _0x3ee81d;};}function handleError(_0x26c88d,_0x53efc1){_0x53efc1=_0x53efc1||0x1f4;return function(_0x5576fa){logger[_0x7593('0x26')](_0x5576fa[_0x7593('0x27')]);if(_0x5576fa['name']){delete _0x5576fa[_0x7593('0x28')];}_0x26c88d[_0x7593('0x19')](_0x53efc1)[_0x7593('0x29')](_0x5576fa);};}exports[_0x7593('0x2a')]=function(_0x390d11,_0x47acee){var _0x11696a={},_0x5abe56={},_0x15e682={'count':0x0,'rows':[]};var _0xa69d73=_[_0x7593('0x2b')](db['AnalyticFieldReport'][_0x7593('0x2c')],function(_0x307845){return{'name':_0x307845[_0x7593('0x2d')],'type':_0x307845['type']['key']};});_0x5abe56[_0x7593('0x2e')]=_[_0x7593('0x2b')](_0xa69d73,'name');_0x5abe56[_0x7593('0x2f')]=_['keys'](_0x390d11[_0x7593('0x2f')]);_0x5abe56['filters']=_['intersection'](_0x5abe56[_0x7593('0x2e')],_0x5abe56[_0x7593('0x2f')]);_0x11696a['attributes']=_['intersection'](_0x5abe56[_0x7593('0x2e')],qs['fields'](_0x390d11[_0x7593('0x2f')]['fields']));_0x11696a[_0x7593('0x30')]=_0x11696a['attributes'][_0x7593('0x31')]?_0x11696a['attributes']:_0x5abe56[_0x7593('0x2e')];if(!_0x390d11[_0x7593('0x2f')][_0x7593('0x32')](_0x7593('0x33'))){_0x11696a[_0x7593('0x1e')]=qs['limit'](_0x390d11['query']['limit']);_0x11696a[_0x7593('0x1b')]=qs['offset'](_0x390d11[_0x7593('0x2f')]['offset']);}_0x11696a['order']=qs[_0x7593('0x34')](_0x390d11[_0x7593('0x2f')][_0x7593('0x34')]);_0x11696a['where']=qs['filters'](_[_0x7593('0x35')](_0x390d11['query'],_0x5abe56['filters']),_0xa69d73);if(_0x390d11[_0x7593('0x2f')][_0x7593('0x36')]){_0x11696a[_0x7593('0x37')]=_[_0x7593('0x38')](_0x11696a[_0x7593('0x37')],{'$or':_[_0x7593('0x2b')](_0xa69d73,function(_0x5909ba){if(_0x5909ba[_0x7593('0x39')]!==_0x7593('0x3a')){var _0x21f027={};_0x21f027[_0x5909ba[_0x7593('0x28')]]={'$like':'%'+_0x390d11[_0x7593('0x2f')]['filter']+'%'};return _0x21f027;}})});}_0x11696a=_['merge']({},_0x11696a,_0x390d11['options']);var _0x33b1c7={'where':_0x11696a[_0x7593('0x37')]};return db[_0x7593('0x3b')][_0x7593('0x1d')](_0x33b1c7)[_0x7593('0x23')](function(_0x37826c){_0x15e682[_0x7593('0x1d')]=_0x37826c;if(_0x390d11[_0x7593('0x2f')]['includeAll']){_0x11696a[_0x7593('0x3c')]=[{'all':!![]}];}return db[_0x7593('0x3b')][_0x7593('0x3d')](_0x11696a);})[_0x7593('0x23')](function(_0x2509bf){_0x15e682[_0x7593('0x3e')]=_0x2509bf;return _0x15e682;})['then'](respondWithFilteredResult(_0x47acee,_0x11696a))['catch'](handleError(_0x47acee,null));};exports[_0x7593('0x3f')]=function(_0x27aac6,_0x198626){var _0x32c862={'raw':![],'where':{'id':_0x27aac6[_0x7593('0x40')]['id']}},_0xfbbdf1={};_0xfbbdf1[_0x7593('0x2e')]=_[_0x7593('0x41')](db[_0x7593('0x3b')][_0x7593('0x2c')]);_0xfbbdf1[_0x7593('0x2f')]=_['keys'](_0x27aac6[_0x7593('0x2f')]);_0xfbbdf1[_0x7593('0x42')]=_[_0x7593('0x43')](_0xfbbdf1[_0x7593('0x2e')],_0xfbbdf1[_0x7593('0x2f')]);_0x32c862['attributes']=_[_0x7593('0x43')](_0xfbbdf1['model'],qs[_0x7593('0x44')](_0x27aac6[_0x7593('0x2f')][_0x7593('0x44')]));_0x32c862[_0x7593('0x30')]=_0x32c862[_0x7593('0x30')][_0x7593('0x31')]?_0x32c862[_0x7593('0x30')]:_0xfbbdf1[_0x7593('0x2e')];if(_0x27aac6[_0x7593('0x2f')][_0x7593('0x45')]){_0x32c862['include']=[{'all':!![]}];}_0x32c862=_[_0x7593('0x38')]({},_0x32c862,_0x27aac6[_0x7593('0x46')]);return db[_0x7593('0x3b')][_0x7593('0x47')](_0x32c862)[_0x7593('0x23')](handleEntityNotFound(_0x198626,null))[_0x7593('0x23')](respondWithResult(_0x198626,null))[_0x7593('0x48')](handleError(_0x198626,null));};exports[_0x7593('0x49')]=function(_0x122a46,_0x4094c0){return db[_0x7593('0x3b')][_0x7593('0x49')](_0x122a46['body'],{})['then'](respondWithResult(_0x4094c0,0xc9))[_0x7593('0x48')](handleError(_0x4094c0,null));};exports[_0x7593('0x4a')]=function(_0x3ffed5,_0x5f0186){return db[_0x7593('0x3b')][_0x7593('0x4a')](_0x3ffed5['body'],{'raw':![],'individualHooks':!![]})[_0x7593('0x23')](respondWithResult(_0x5f0186,0xc9))[_0x7593('0x48')](handleError(_0x5f0186,null));};exports[_0x7593('0x22')]=function(_0x17e271,_0x13b8b0){if(_0x17e271['body']['id']){delete _0x17e271[_0x7593('0x4b')]['id'];}return db[_0x7593('0x3b')]['find']({'where':{'id':_0x17e271[_0x7593('0x40')]['id']}})[_0x7593('0x23')](handleEntityNotFound(_0x13b8b0,null))[_0x7593('0x23')](saveUpdates(_0x17e271[_0x7593('0x4b')],null))[_0x7593('0x23')](respondWithResult(_0x13b8b0,null))[_0x7593('0x48')](handleError(_0x13b8b0,null));};exports['destroy']=function(_0x39395a,_0x2741b7){return db['AnalyticFieldReport'][_0x7593('0x47')]({'where':{'id':_0x39395a[_0x7593('0x40')]['id']}})[_0x7593('0x23')](handleEntityNotFound(_0x2741b7,null))[_0x7593('0x23')](removeEntity(_0x2741b7,null))[_0x7593('0x48')](handleError(_0x2741b7,null));};exports[_0x7593('0x4c')]=function(_0x1663ee,_0x27a2a6){return db[_0x7593('0x3b')][_0x7593('0x24')]({'where':{'id':_0x1663ee[_0x7593('0x2f')][_0x7593('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x27a2a6,0xcc))[_0x7593('0x48')](handleError(_0x27a2a6,null));};exports[_0x7593('0x4e')]=function(_0x4f5f56,_0x57bd3f,_0x5a653b){return db[_0x7593('0x4f')][_0x7593('0x50')]({'where':{'id':_0x4f5f56[_0x7593('0x40')]['id']}})[_0x7593('0x23')](handleEntityNotFound(_0x57bd3f,null))['then'](function(_0x440c67){if(_0x440c67){return db[_0x7593('0x51')][_0x7593('0x52')](function(_0x2b050c){return db[_0x7593('0x3b')]['destroy']({'where':{'CustomReportId':_0x4f5f56[_0x7593('0x40')]['id']},'transaction':_0x2b050c})[_0x7593('0x23')](function(_0x13d5d8){var _0x5b25c7=_['map'](_0x4f5f56[_0x7593('0x4b')],function(_0xdeb4ca){delete _0xdeb4ca['id'];_0xdeb4ca[_0x7593('0x53')]=_0x4f5f56[_0x7593('0x40')]['id'];return _0xdeb4ca;});return db[_0x7593('0x3b')]['bulkCreate'](_0x5b25c7,{'transaction':_0x2b050c});});})[_0x7593('0x23')](function(){return db[_0x7593('0x3b')]['findAll']({'where':{'CustomReportId':_0x4f5f56[_0x7593('0x40')]['id']}});});}})[_0x7593('0x23')](respondWithResult(_0x57bd3f,null))[_0x7593('0x48')](handleError(_0x57bd3f,null));};
\ No newline at end of file
+var _0xd147=['rows','catch','show','keys','merge','options','find','create','body','bulkCreate','params','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','includeAll','include'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0xd147,0xb1));var _0x7d14=function(_0x4791bb,_0x191223){_0x4791bb=_0x4791bb-0x0;var _0x3431b2=_0xd147[_0x4791bb];return _0x3431b2;};'use strict';var emlformat=require(_0x7d14('0x0'));var rimraf=require(_0x7d14('0x1'));var zipdir=require(_0x7d14('0x2'));var jsonpatch=require(_0x7d14('0x3'));var rp=require(_0x7d14('0x4'));var moment=require(_0x7d14('0x5'));var BPromise=require(_0x7d14('0x6'));var Mustache=require(_0x7d14('0x7'));var util=require(_0x7d14('0x8'));var path=require(_0x7d14('0x9'));var sox=require(_0x7d14('0xa'));var csv=require(_0x7d14('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d14('0xc'));var _=require(_0x7d14('0xd'));var squel=require('squel');var crypto=require(_0x7d14('0xe'));var jsforce=require(_0x7d14('0xf'));var deskjs=require(_0x7d14('0x10'));var toCsv=require(_0x7d14('0xb'));var querystring=require(_0x7d14('0x11'));var Papa=require('papaparse');var Redis=require(_0x7d14('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7d14('0x13'));var as=require(_0x7d14('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d14('0x15'))('api');var utils=require(_0x7d14('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7d14('0x17'));var db=require(_0x7d14('0x18'))['db'];function respondWithStatusCode(_0x20e251,_0x40833a){_0x40833a=_0x40833a||0xcc;return function(_0x3c9123){if(_0x3c9123){return _0x20e251[_0x7d14('0x19')](_0x40833a);}return _0x20e251[_0x7d14('0x1a')](_0x40833a)['end']();};}function respondWithResult(_0xda8910,_0x599115){_0x599115=_0x599115||0xc8;return function(_0x4369e8){if(_0x4369e8){return _0xda8910[_0x7d14('0x1a')](_0x599115)[_0x7d14('0x1b')](_0x4369e8);}};}function respondWithFilteredResult(_0x5e58f3,_0x2b159a){return function(_0x22a594){if(_0x22a594){var _0xaaceba=typeof _0x2b159a[_0x7d14('0x1c')]===_0x7d14('0x1d')&&typeof _0x2b159a[_0x7d14('0x1e')]===_0x7d14('0x1d');var _0x2d5ca7=_0x22a594[_0x7d14('0x1f')];var _0x447729=_0xaaceba?0x0:_0x2b159a['offset'];var _0x4ae848=_0xaaceba?_0x22a594[_0x7d14('0x1f')]:_0x2b159a[_0x7d14('0x1c')]+_0x2b159a['limit'];var _0xac70a9;if(_0x4ae848>=_0x2d5ca7){_0x4ae848=_0x2d5ca7;_0xac70a9=0xc8;}else{_0xac70a9=0xce;}_0x5e58f3[_0x7d14('0x1a')](_0xac70a9);return _0x5e58f3[_0x7d14('0x20')]('Content-Range',_0x447729+'-'+_0x4ae848+'/'+_0x2d5ca7)['json'](_0x22a594);}return null;};}function patchUpdates(_0x47e05a){return function(_0x4cea4d){try{jsonpatch[_0x7d14('0x21')](_0x4cea4d,_0x47e05a,!![]);}catch(_0x25005f){return BPromise[_0x7d14('0x22')](_0x25005f);}return _0x4cea4d['save']();};}function saveUpdates(_0x1ee50b,_0x152f7d){return function(_0x156ada){if(_0x156ada){return _0x156ada[_0x7d14('0x23')](_0x1ee50b)[_0x7d14('0x24')](function(_0x216f18){return _0x216f18;});}return null;};}function removeEntity(_0x29c28d,_0x565bf6){return function(_0xf1cf06){if(_0xf1cf06){return _0xf1cf06[_0x7d14('0x25')]()[_0x7d14('0x24')](function(){_0x29c28d[_0x7d14('0x1a')](0xcc)[_0x7d14('0x26')]();});}};}function handleEntityNotFound(_0x346350,_0xce1af7){return function(_0x18dad3){if(!_0x18dad3){_0x346350[_0x7d14('0x19')](0x194);}return _0x18dad3;};}function handleError(_0x12db7e,_0x2acaa4){_0x2acaa4=_0x2acaa4||0x1f4;return function(_0x55f7ce){logger[_0x7d14('0x27')](_0x55f7ce[_0x7d14('0x28')]);if(_0x55f7ce[_0x7d14('0x29')]){delete _0x55f7ce[_0x7d14('0x29')];}_0x12db7e[_0x7d14('0x1a')](_0x2acaa4)['send'](_0x55f7ce);};}exports[_0x7d14('0x2a')]=function(_0x494ef5,_0x25f456){var _0x1c7d47={},_0x2bf100={},_0x510e20={'count':0x0,'rows':[]};var _0x43ded7=_[_0x7d14('0x2b')](db[_0x7d14('0x2c')][_0x7d14('0x2d')],function(_0x117e22){return{'name':_0x117e22[_0x7d14('0x2e')],'type':_0x117e22['type']['key']};});_0x2bf100['model']=_[_0x7d14('0x2b')](_0x43ded7,_0x7d14('0x29'));_0x2bf100[_0x7d14('0x2f')]=_['keys'](_0x494ef5['query']);_0x2bf100[_0x7d14('0x30')]=_[_0x7d14('0x31')](_0x2bf100[_0x7d14('0x32')],_0x2bf100[_0x7d14('0x2f')]);_0x1c7d47[_0x7d14('0x33')]=_[_0x7d14('0x31')](_0x2bf100[_0x7d14('0x32')],qs['fields'](_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x34')]));_0x1c7d47[_0x7d14('0x33')]=_0x1c7d47[_0x7d14('0x33')][_0x7d14('0x35')]?_0x1c7d47[_0x7d14('0x33')]:_0x2bf100[_0x7d14('0x32')];if(!_0x494ef5['query']['hasOwnProperty'](_0x7d14('0x36'))){_0x1c7d47['limit']=qs[_0x7d14('0x1e')](_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x1e')]);_0x1c7d47[_0x7d14('0x1c')]=qs[_0x7d14('0x1c')](_0x494ef5['query'][_0x7d14('0x1c')]);}_0x1c7d47[_0x7d14('0x37')]=qs[_0x7d14('0x38')](_0x494ef5[_0x7d14('0x2f')]['sort']);_0x1c7d47['where']=qs['filters'](_['pick'](_0x494ef5['query'],_0x2bf100[_0x7d14('0x30')]),_0x43ded7);if(_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x39')]){_0x1c7d47[_0x7d14('0x3a')]=_['merge'](_0x1c7d47['where'],{'$or':_[_0x7d14('0x2b')](_0x43ded7,function(_0x5b9c88){if(_0x5b9c88[_0x7d14('0x3b')]!==_0x7d14('0x3c')){var _0x3c3e66={};_0x3c3e66[_0x5b9c88[_0x7d14('0x29')]]={'$like':'%'+_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x39')]+'%'};return _0x3c3e66;}})});}_0x1c7d47=_['merge']({},_0x1c7d47,_0x494ef5['options']);var _0x4432d9={'where':_0x1c7d47[_0x7d14('0x3a')]};return db[_0x7d14('0x2c')][_0x7d14('0x1f')](_0x4432d9)[_0x7d14('0x24')](function(_0x15b569){_0x510e20[_0x7d14('0x1f')]=_0x15b569;if(_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x3d')]){_0x1c7d47[_0x7d14('0x3e')]=[{'all':!![]}];}return db[_0x7d14('0x2c')]['findAll'](_0x1c7d47);})[_0x7d14('0x24')](function(_0x57b514){_0x510e20[_0x7d14('0x3f')]=_0x57b514;return _0x510e20;})[_0x7d14('0x24')](respondWithFilteredResult(_0x25f456,_0x1c7d47))[_0x7d14('0x40')](handleError(_0x25f456,null));};exports[_0x7d14('0x41')]=function(_0x371be0,_0x1affd5){var _0x34563f={'raw':![],'where':{'id':_0x371be0['params']['id']}},_0x4519bf={};_0x4519bf['model']=_['keys'](db[_0x7d14('0x2c')][_0x7d14('0x2d')]);_0x4519bf[_0x7d14('0x2f')]=_[_0x7d14('0x42')](_0x371be0[_0x7d14('0x2f')]);_0x4519bf['filters']=_[_0x7d14('0x31')](_0x4519bf[_0x7d14('0x32')],_0x4519bf['query']);_0x34563f['attributes']=_[_0x7d14('0x31')](_0x4519bf[_0x7d14('0x32')],qs[_0x7d14('0x34')](_0x371be0[_0x7d14('0x2f')][_0x7d14('0x34')]));_0x34563f['attributes']=_0x34563f[_0x7d14('0x33')][_0x7d14('0x35')]?_0x34563f[_0x7d14('0x33')]:_0x4519bf[_0x7d14('0x32')];if(_0x371be0[_0x7d14('0x2f')][_0x7d14('0x3d')]){_0x34563f[_0x7d14('0x3e')]=[{'all':!![]}];}_0x34563f=_[_0x7d14('0x43')]({},_0x34563f,_0x371be0[_0x7d14('0x44')]);return db[_0x7d14('0x2c')][_0x7d14('0x45')](_0x34563f)['then'](handleEntityNotFound(_0x1affd5,null))[_0x7d14('0x24')](respondWithResult(_0x1affd5,null))['catch'](handleError(_0x1affd5,null));};exports[_0x7d14('0x46')]=function(_0x5c90a0,_0x4414bc){return db[_0x7d14('0x2c')][_0x7d14('0x46')](_0x5c90a0[_0x7d14('0x47')],{})[_0x7d14('0x24')](respondWithResult(_0x4414bc,0xc9))[_0x7d14('0x40')](handleError(_0x4414bc,null));};exports[_0x7d14('0x48')]=function(_0x549ec6,_0xff1fda){return db['AnalyticFieldReport']['bulkCreate'](_0x549ec6[_0x7d14('0x47')],{'raw':![],'individualHooks':!![]})[_0x7d14('0x24')](respondWithResult(_0xff1fda,0xc9))[_0x7d14('0x40')](handleError(_0xff1fda,null));};exports[_0x7d14('0x23')]=function(_0x3a810e,_0x1a049a){if(_0x3a810e['body']['id']){delete _0x3a810e[_0x7d14('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7d14('0x45')]({'where':{'id':_0x3a810e[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x1a049a,null))[_0x7d14('0x24')](saveUpdates(_0x3a810e[_0x7d14('0x47')],null))[_0x7d14('0x24')](respondWithResult(_0x1a049a,null))[_0x7d14('0x40')](handleError(_0x1a049a,null));};exports[_0x7d14('0x25')]=function(_0x2bfc0c,_0x340429){return db[_0x7d14('0x2c')][_0x7d14('0x45')]({'where':{'id':_0x2bfc0c[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x340429,null))[_0x7d14('0x24')](removeEntity(_0x340429,null))[_0x7d14('0x40')](handleError(_0x340429,null));};exports['bulkDestroy']=function(_0x223cf4,_0x436de1){return db[_0x7d14('0x2c')][_0x7d14('0x25')]({'where':{'id':_0x223cf4[_0x7d14('0x2f')][_0x7d14('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x7d14('0x24')](respondWithResult(_0x436de1,0xcc))[_0x7d14('0x40')](handleError(_0x436de1,null));};exports[_0x7d14('0x4b')]=function(_0x21353a,_0x3263d8,_0x1ad263){return db[_0x7d14('0x4c')]['findOne']({'where':{'id':_0x21353a[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x3263d8,null))[_0x7d14('0x24')](function(_0x2f766e){if(_0x2f766e){return db[_0x7d14('0x4d')][_0x7d14('0x4e')](function(_0x1fa00e){return db[_0x7d14('0x2c')][_0x7d14('0x25')]({'where':{'CustomReportId':_0x21353a[_0x7d14('0x49')]['id']},'transaction':_0x1fa00e})['then'](function(_0x982741){var _0x14bc5b=_['map'](_0x21353a[_0x7d14('0x47')],function(_0x20c627){delete _0x20c627['id'];_0x20c627[_0x7d14('0x4f')]=_0x21353a[_0x7d14('0x49')]['id'];return _0x20c627;});return db[_0x7d14('0x2c')][_0x7d14('0x48')](_0x14bc5b,{'transaction':_0x1fa00e});});})[_0x7d14('0x24')](function(){return db[_0x7d14('0x2c')]['findAll']({'where':{'CustomReportId':_0x21353a[_0x7d14('0x49')]['id']}});});}})['then'](respondWithResult(_0x3263d8,null))[_0x7d14('0x40')](handleError(_0x3263d8,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index b928b2b..1434ba9 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 _0xcec5=['define','AnalyticFieldReport','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x338b5c,_0x1a4fec){var _0x2f9a67=function(_0x15015e){while(--_0x15015e){_0x338b5c['push'](_0x338b5c['shift']());}};_0x2f9a67(++_0x1a4fec);}(_0xcec5,0x11a));var _0x5cec=function(_0x3d244b,_0x34a8ce){_0x3d244b=_0x3d244b-0x0;var _0x1c7af2=_0xcec5[_0x3d244b];return _0x1c7af2;};'use strict';var _=require('lodash');var util=require(_0x5cec('0x0'));var logger=require(_0x5cec('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5cec('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cec('0x3'));var rimraf=require(_0x5cec('0x4'));var config=require(_0x5cec('0x5'));var attributes=require(_0x5cec('0x6'));module[_0x5cec('0x7')]=function(_0x16d881,_0x2bc1a8){return _0x16d881[_0x5cec('0x8')](_0x5cec('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb347=['bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment'];(function(_0x130507,_0x55a00e){var _0x34e1d5=function(_0x4f88bf){while(--_0x4f88bf){_0x130507['push'](_0x130507['shift']());}};_0x34e1d5(++_0x55a00e);}(_0xb347,0x104));var _0x7b34=function(_0x3df874,_0x819192){_0x3df874=_0x3df874-0x0;var _0x1d6b01=_0xb347[_0x3df874];return _0x1d6b01;};'use strict';var _=require(_0x7b34('0x0'));var util=require(_0x7b34('0x1'));var logger=require(_0x7b34('0x2'))('api');var moment=require(_0x7b34('0x3'));var BPromise=require(_0x7b34('0x4'));var rp=require(_0x7b34('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b34('0x6'));var config=require(_0x7b34('0x7'));var attributes=require(_0x7b34('0x8'));module[_0x7b34('0x9')]=function(_0x37737f,_0x4f56fd){return _0x37737f['define'](_0x7b34('0xa'),attributes,{'tableName':_0x7b34('0xb'),'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 4549ecf..431ef6a 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 _0x69ea=['debug','stringify','error','code','message','result','catch','util','moment','../../config/environment','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0xb66f92,_0x301f99){var _0x344d2d=function(_0x34378c){while(--_0x34378c){_0xb66f92['push'](_0xb66f92['shift']());}};_0x344d2d(++_0x301f99);}(_0x69ea,0x142));var _0xa69e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x69ea[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xa69e('0x0'));var moment=require(_0xa69e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa69e('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x400c4b,_0x42b759,_0x8c4e38){return new BPromise(function(_0x5be6f4,_0x4d4d33){return client[_0xa69e('0x3')](_0x400c4b,_0x8c4e38)[_0xa69e('0x4')](function(_0x5b9440){logger[_0xa69e('0x5')](_0xa69e('0x6'),_0x42b759,_0xa69e('0x7'));logger[_0xa69e('0x8')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x42b759,_0xa69e('0x7'),JSON[_0xa69e('0x9')](_0x5b9440));if(_0x5b9440[_0xa69e('0xa')]){if(_0x5b9440[_0xa69e('0xa')][_0xa69e('0xb')]===0x1f4){logger[_0xa69e('0xa')](_0xa69e('0x6'),_0x42b759,_0x5b9440[_0xa69e('0xa')][_0xa69e('0xc')]);return _0x4d4d33(_0x5b9440['error'][_0xa69e('0xc')]);}logger[_0xa69e('0xa')](_0xa69e('0x6'),_0x42b759,_0x5b9440['error']['message']);return _0x5be6f4(_0x5b9440[_0xa69e('0xa')][_0xa69e('0xc')]);}else{logger[_0xa69e('0x5')](_0xa69e('0x6'),_0x42b759,'request\x20sent');_0x5be6f4(_0x5b9440[_0xa69e('0xd')][_0xa69e('0xc')]);}})[_0xa69e('0xe')](function(_0x5d20f3){logger[_0xa69e('0xa')](_0xa69e('0x6'),_0x42b759,_0x5d20f3);_0x4d4d33(_0x5d20f3);});});}
\ No newline at end of file
+var _0xb9c6=['../../config/environment','jayson/promise','client','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xb9c6,0x1aa));var _0x6b9c=function(_0x15c0a8,_0x3b0c8b){_0x15c0a8=_0x15c0a8-0x0;var _0x4a1943=_0xb9c6[_0x15c0a8];return _0x4a1943;};'use strict';var _=require(_0x6b9c('0x0'));var util=require(_0x6b9c('0x1'));var moment=require(_0x6b9c('0x2'));var BPromise=require(_0x6b9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b9c('0x4'));var db=require(_0x6b9c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6b9c('0x6'));var jayson=require(_0x6b9c('0x7'));var client=jayson[_0x6b9c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44b505,_0x91dd39,_0x48a116){return new BPromise(function(_0x353bd3,_0xa3c8a){return client['request'](_0x44b505,_0x48a116)[_0x6b9c('0x9')](function(_0x1e5ce8){logger['info'](_0x6b9c('0xa'),_0x91dd39,_0x6b9c('0xb'));logger['debug'](_0x6b9c('0xc'),_0x91dd39,_0x6b9c('0xb'),JSON['stringify'](_0x1e5ce8));if(_0x1e5ce8[_0x6b9c('0xd')]){if(_0x1e5ce8['error']['code']===0x1f4){logger[_0x6b9c('0xd')](_0x6b9c('0xa'),_0x91dd39,_0x1e5ce8[_0x6b9c('0xd')][_0x6b9c('0xe')]);return _0xa3c8a(_0x1e5ce8[_0x6b9c('0xd')][_0x6b9c('0xe')]);}logger[_0x6b9c('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x91dd39,_0x1e5ce8['error'][_0x6b9c('0xe')]);return _0x353bd3(_0x1e5ce8['error'][_0x6b9c('0xe')]);}else{logger[_0x6b9c('0xf')](_0x6b9c('0xa'),_0x91dd39,_0x6b9c('0xb'));_0x353bd3(_0x1e5ce8[_0x6b9c('0x10')]['message']);}})[_0x6b9c('0x11')](function(_0x837a13){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x91dd39,_0x837a13);_0xa3c8a(_0x837a13);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index fea20cc..24ee471 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 _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x26eb68,_0x87ffb2){var _0x4074e5=function(_0xd901d3){while(--_0xd901d3){_0x26eb68['push'](_0x26eb68['shift']());}};_0x4074e5(++_0x87ffb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x25f743,_0x27841d){var _0x48bba1=function(_0x59430c){while(--_0x59430c){_0x25f743['push'](_0x25f743['shift']());}};_0x48bba1(++_0x27841d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('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 8ab037f..cc0c500 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 _0xee4f=['TEXT','sequelize','name','STRING'];(function(_0x2c94af,_0x179897){var _0x9d1bf6=function(_0x11499c){while(--_0x11499c){_0x2c94af['push'](_0x2c94af['shift']());}};_0x9d1bf6(++_0x179897);}(_0xee4f,0xad));var _0xfee4=function(_0xea6b6a,_0x5de9e5){_0xea6b6a=_0xea6b6a-0x0;var _0x1eeab2=_0xee4f[_0xea6b6a];return _0x1eeab2;};'use strict';var Sequelize=require(_0xfee4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfee4('0x1')},'table':{'type':Sequelize[_0xfee4('0x2')]},'metric':{'type':Sequelize[_0xfee4('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd957=['exports','name','STRING','sequelize'];(function(_0x2191fb,_0x4497b2){var _0x435aa6=function(_0x55b09d){while(--_0x55b09d){_0x2191fb['push'](_0x2191fb['shift']());}};_0x435aa6(++_0x4497b2);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d95('0x2')},'table':{'type':Sequelize[_0x7d95('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d95('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ebda695..aec5ec5 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 _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x7da7,0x10d));var _0x77da=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x7da7[_0x285800];return _0x4b809e;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));};
\ No newline at end of file
+var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x10c7e0,_0x484507){var _0x330990=function(_0x3b5317){while(--_0x3b5317){_0x10c7e0['push'](_0x10c7e0['shift']());}};_0x330990(++_0x484507);}(_0x425d,0x1e0));var _0xd425=function(_0x2eb207,_0x504197){_0x2eb207=_0x2eb207-0x0;var _0x3afb71=_0x425d[_0x2eb207];return _0x3afb71;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index e297f4b..fa835c5 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 _0xbac8=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xbac8,0x140));var _0x8bac=function(_0x13ad5d,_0x4b071b){_0x13ad5d=_0x13ad5d-0x0;var _0x213ef8=_0xbac8[_0x13ad5d];return _0x213ef8;};'use strict';var _=require(_0x8bac('0x0'));var util=require(_0x8bac('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8bac('0x2'));var BPromise=require(_0x8bac('0x3'));var rp=require(_0x8bac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8bac('0x5'));var config=require(_0x8bac('0x6'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x28b1d1,_0x36f5b4){return _0x28b1d1[_0x8bac('0x7')](_0x8bac('0x8'),attributes,{'tableName':_0x8bac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f6b=['bluebird','path','rimraf','./analyticMetric.attributes','define','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x31c3ec,_0x41a015){var _0x319164=function(_0x52c298){while(--_0x52c298){_0x31c3ec['push'](_0x31c3ec['shift']());}};_0x319164(++_0x41a015);}(_0x8f6b,0x146));var _0xb8f6=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8f6b[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xb8f6('0x0'));var util=require(_0xb8f6('0x1'));var logger=require(_0xb8f6('0x2'))('api');var moment=require(_0xb8f6('0x3'));var BPromise=require(_0xb8f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8f6('0x5'));var rimraf=require(_0xb8f6('0x6'));var config=require('../../config/environment');var attributes=require(_0xb8f6('0x7'));module['exports']=function(_0x332ce0,_0x4c73ad){return _0x332ce0[_0xb8f6('0x8')]('AnalyticMetric',attributes,{'tableName':_0xb8f6('0x9'),'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 5819c5b..f8014eb 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 _0x4572=['then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x227f59,_0xeecf9d){var _0x2da8c0=function(_0xb5319e){while(--_0xb5319e){_0x227f59['push'](_0x227f59['shift']());}};_0x2da8c0(++_0xeecf9d);}(_0x4572,0x106));var _0x2457=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x4572[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x2457('0x0'));var util=require(_0x2457('0x1'));var moment=require(_0x2457('0x2'));var BPromise=require(_0x2457('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2457('0x4'));var db=require(_0x2457('0x5'))['db'];var utils=require(_0x2457('0x6'));var logger=require(_0x2457('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2457('0x8'));var client=jayson['client'][_0x2457('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa34ed6,_0x4c10ca,_0x16ce42){return new BPromise(function(_0x44b5a5,_0xb7cecc){return client[_0x2457('0xa')](_0xa34ed6,_0x16ce42)[_0x2457('0xb')](function(_0x47e881){logger[_0x2457('0xc')](_0x2457('0xd'),_0x4c10ca,'request\x20sent');logger['debug'](_0x2457('0xe'),_0x4c10ca,_0x2457('0xf'),JSON[_0x2457('0x10')](_0x47e881));if(_0x47e881[_0x2457('0x11')]){if(_0x47e881[_0x2457('0x11')][_0x2457('0x12')]===0x1f4){logger['error'](_0x2457('0xd'),_0x4c10ca,_0x47e881[_0x2457('0x11')][_0x2457('0x13')]);return _0xb7cecc(_0x47e881[_0x2457('0x11')][_0x2457('0x13')]);}logger[_0x2457('0x11')](_0x2457('0xd'),_0x4c10ca,_0x47e881[_0x2457('0x11')][_0x2457('0x13')]);return _0x44b5a5(_0x47e881[_0x2457('0x11')]['message']);}else{logger[_0x2457('0xc')](_0x2457('0xd'),_0x4c10ca,_0x2457('0xf'));_0x44b5a5(_0x47e881['result'][_0x2457('0x13')]);}})[_0x2457('0x14')](function(_0x2079e7){logger[_0x2457('0x11')](_0x2457('0xd'),_0x4c10ca,_0x2079e7);_0xb7cecc(_0x2079e7);});});}
\ No newline at end of file
+var _0x0639=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','moment','bluebird'];(function(_0x35b7a3,_0x9e0044){var _0x3be8e4=function(_0x1407ae){while(--_0x1407ae){_0x35b7a3['push'](_0x35b7a3['shift']());}};_0x3be8e4(++_0x9e0044);}(_0x0639,0x173));var _0x9063=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x0639[_0x1b70e3];return _0x1452ab;};'use strict';var _=require(_0x9063('0x0'));var util=require('util');var moment=require(_0x9063('0x1'));var BPromise=require(_0x9063('0x2'));var rs=require(_0x9063('0x3'));var fs=require('fs');var Redis=require(_0x9063('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9063('0x5'));var logger=require(_0x9063('0x6'))(_0x9063('0x7'));var config=require(_0x9063('0x8'));var jayson=require(_0x9063('0x9'));var client=jayson[_0x9063('0xa')][_0x9063('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x582d15,_0x46bc11,_0x34398d){return new BPromise(function(_0x1b1940,_0x5b1cd5){return client[_0x9063('0xc')](_0x582d15,_0x34398d)['then'](function(_0x23bcdc){logger[_0x9063('0xd')](_0x9063('0xe'),_0x46bc11,_0x9063('0xf'));logger[_0x9063('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x46bc11,_0x9063('0xf'),JSON[_0x9063('0x11')](_0x23bcdc));if(_0x23bcdc['error']){if(_0x23bcdc['error'][_0x9063('0x12')]===0x1f4){logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);return _0x5b1cd5(_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);}logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);return _0x1b1940(_0x23bcdc['error'][_0x9063('0x14')]);}else{logger['info'](_0x9063('0xe'),_0x46bc11,_0x9063('0xf'));_0x1b1940(_0x23bcdc['result'][_0x9063('0x14')]);}})[_0x9063('0x15')](function(_0x29c1bf){logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x29c1bf);_0x5b1cd5(_0x29c1bf);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 49f3eb3..e89adc8 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 _0x88b0=['../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post','create','update','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x16dfb3,_0x1613fc){var _0x1d8030=function(_0x1bd5da){while(--_0x1bd5da){_0x16dfb3['push'](_0x16dfb3['shift']());}};_0x1d8030(++_0x1613fc);}(_0x88b0,0x1cb));var _0x088b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x88b0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x088b('0x0'));var util=require(_0x088b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x088b('0x2'));var router=express[_0x088b('0x3')]();var fs_extra=require(_0x088b('0x4'));var auth=require(_0x088b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x088b('0x6'));var controller=require(_0x088b('0x7'));router[_0x088b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x088b('0x8')](_0x088b('0x9'),auth[_0x088b('0xa')](),controller[_0x088b('0xb')]);router[_0x088b('0xc')]('/',auth[_0x088b('0xa')](),controller[_0x088b('0xd')]);router['put'](_0x088b('0x9'),auth['isAuthenticated'](),controller[_0x088b('0xe')]);router['delete'](_0x088b('0x9'),auth[_0x088b('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf842=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x47878f,_0x48d3bf){var _0x4b05b8=function(_0x3d6597){while(--_0x3d6597){_0x47878f['push'](_0x47878f['shift']());}};_0x4b05b8(++_0x48d3bf);}(_0xf842,0x172));var _0x2f84=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xf842[_0x1fa759];return _0x2da9f4;};'use strict';var multer=require(_0x2f84('0x0'));var util=require(_0x2f84('0x1'));var path=require(_0x2f84('0x2'));var timeout=require(_0x2f84('0x3'));var express=require('express');var router=express[_0x2f84('0x4')]();var fs_extra=require(_0x2f84('0x5'));var auth=require(_0x2f84('0x6'));var interaction=require(_0x2f84('0x7'));var config=require(_0x2f84('0x8'));var controller=require('./analyticMetric.controller');router[_0x2f84('0x9')]('/',auth[_0x2f84('0xa')](),controller[_0x2f84('0xb')]);router['get'](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller[_0x2f84('0xd')]);router[_0x2f84('0xe')]('/',auth[_0x2f84('0xa')](),controller[_0x2f84('0xf')]);router[_0x2f84('0x10')](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller[_0x2f84('0x11')]);router['delete'](_0x2f84('0xc'),auth['isAuthenticated'](),controller[_0x2f84('0x12')]);module[_0x2f84('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index d956770..83897c8 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 _0xbc8b=['exports'];(function(_0x509dfd,_0x52d06c){var _0x469a63=function(_0x399f29){while(--_0x399f29){_0x509dfd['push'](_0x509dfd['shift']());}};_0x469a63(++_0x52d06c);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xbc8b[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require('sequelize');module[_0xbbc8('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x83bd=['sequelize','TEXT'];(function(_0x55e537,_0x464d61){var _0x2dbbe1=function(_0x158d9f){while(--_0x158d9f){_0x55e537['push'](_0x55e537['shift']());}};_0x2dbbe1(++_0x464d61);}(_0x83bd,0x160));var _0xd83b=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x83bd[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0xd83b('0x0'));module['exports']={'tree':{'type':Sequelize[_0xd83b('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 3aa6bde..f07deb7 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 _0x9c21=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox'];(function(_0x3ccd40,_0x538726){var _0x45baf0=function(_0x5d6c70){while(--_0x5d6c70){_0x3ccd40['push'](_0x3ccd40['shift']());}};_0x45baf0(++_0x538726);}(_0x9c21,0x178));var _0x19c2=function(_0xc137,_0x3011df){_0xc137=_0xc137-0x0;var _0x36ace7=_0x9c21[_0xc137];return _0x36ace7;};'use strict';var emlformat=require(_0x19c2('0x0'));var rimraf=require(_0x19c2('0x1'));var zipdir=require(_0x19c2('0x2'));var jsonpatch=require(_0x19c2('0x3'));var rp=require('request-promise');var moment=require(_0x19c2('0x4'));var BPromise=require(_0x19c2('0x5'));var Mustache=require(_0x19c2('0x6'));var util=require('util');var path=require(_0x19c2('0x7'));var sox=require(_0x19c2('0x8'));var csv=require('to-csv');var ejs=require(_0x19c2('0x9'));var fs=require('fs');var fs_extra=require(_0x19c2('0xa'));var _=require(_0x19c2('0xb'));var squel=require(_0x19c2('0xc'));var crypto=require(_0x19c2('0xd'));var jsforce=require(_0x19c2('0xe'));var deskjs=require(_0x19c2('0xf'));var toCsv=require(_0x19c2('0x10'));var querystring=require(_0x19c2('0x11'));var Papa=require(_0x19c2('0x12'));var Redis=require(_0x19c2('0x13'));var authService=require(_0x19c2('0x14'));var qs=require(_0x19c2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x19c2('0x16'));var utils=require(_0x19c2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x19c2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbd62fd,_0x5cb7cf){_0x5cb7cf=_0x5cb7cf||0xcc;return function(_0x166c4e){if(_0x166c4e){return _0xbd62fd[_0x19c2('0x19')](_0x5cb7cf);}return _0xbd62fd[_0x19c2('0x1a')](_0x5cb7cf)[_0x19c2('0x1b')]();};}function respondWithResult(_0x3407b8,_0x3fa1bc){_0x3fa1bc=_0x3fa1bc||0xc8;return function(_0x5b016a){if(_0x5b016a){return _0x3407b8[_0x19c2('0x1a')](_0x3fa1bc)[_0x19c2('0x1c')](_0x5b016a);}};}function respondWithFilteredResult(_0x5ef532,_0x382cdd){return function(_0x84dc58){if(_0x84dc58){var _0x4ce53f=typeof _0x382cdd['offset']==='undefined'&&typeof _0x382cdd['limit']===_0x19c2('0x1d');var _0x717670=_0x84dc58[_0x19c2('0x1e')];var _0x4e16e2=_0x4ce53f?0x0:_0x382cdd[_0x19c2('0x1f')];var _0x4908f6=_0x4ce53f?_0x84dc58[_0x19c2('0x1e')]:_0x382cdd[_0x19c2('0x1f')]+_0x382cdd[_0x19c2('0x20')];var _0x658752;if(_0x4908f6>=_0x717670){_0x4908f6=_0x717670;_0x658752=0xc8;}else{_0x658752=0xce;}_0x5ef532[_0x19c2('0x1a')](_0x658752);return _0x5ef532[_0x19c2('0x21')](_0x19c2('0x22'),_0x4e16e2+'-'+_0x4908f6+'/'+_0x717670)['json'](_0x84dc58);}return null;};}function patchUpdates(_0x471576){return function(_0x49358f){try{jsonpatch[_0x19c2('0x23')](_0x49358f,_0x471576,!![]);}catch(_0xca76d4){return BPromise['reject'](_0xca76d4);}return _0x49358f['save']();};}function saveUpdates(_0x159252,_0xebf064){return function(_0x510153){if(_0x510153){return _0x510153[_0x19c2('0x24')](_0x159252)['then'](function(_0x53095a){return _0x53095a;});}return null;};}function removeEntity(_0x166272,_0x244298){return function(_0x17b7af){if(_0x17b7af){return _0x17b7af[_0x19c2('0x25')]()[_0x19c2('0x26')](function(){_0x166272[_0x19c2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bc883,_0x36daee){return function(_0x2e6ba4){if(!_0x2e6ba4){_0x1bc883[_0x19c2('0x19')](0x194);}return _0x2e6ba4;};}function handleError(_0xeaf4ef,_0x16d750){_0x16d750=_0x16d750||0x1f4;return function(_0x24a6cc){logger[_0x19c2('0x27')](_0x24a6cc[_0x19c2('0x28')]);if(_0x24a6cc[_0x19c2('0x29')]){delete _0x24a6cc[_0x19c2('0x29')];}_0xeaf4ef[_0x19c2('0x1a')](_0x16d750)[_0x19c2('0x2a')](_0x24a6cc);};}exports[_0x19c2('0x2b')]=function(_0x58d51b,_0x4cbc3c){var _0x5f1f0f={},_0x4f6c72={},_0x59790b={'count':0x0,'rows':[]};var _0x5e44cf=_[_0x19c2('0x2c')](db[_0x19c2('0x2d')][_0x19c2('0x2e')],function(_0x3a7baa){return{'name':_0x3a7baa[_0x19c2('0x2f')],'type':_0x3a7baa[_0x19c2('0x30')][_0x19c2('0x31')]};});_0x4f6c72[_0x19c2('0x32')]=_[_0x19c2('0x2c')](_0x5e44cf,_0x19c2('0x29'));_0x4f6c72[_0x19c2('0x33')]=_['keys'](_0x58d51b[_0x19c2('0x33')]);_0x4f6c72[_0x19c2('0x34')]=_['intersection'](_0x4f6c72[_0x19c2('0x32')],_0x4f6c72['query']);_0x5f1f0f[_0x19c2('0x35')]=_[_0x19c2('0x36')](_0x4f6c72[_0x19c2('0x32')],qs[_0x19c2('0x37')](_0x58d51b[_0x19c2('0x33')][_0x19c2('0x37')]));_0x5f1f0f['attributes']=_0x5f1f0f[_0x19c2('0x35')][_0x19c2('0x38')]?_0x5f1f0f[_0x19c2('0x35')]:_0x4f6c72['model'];if(!_0x58d51b[_0x19c2('0x33')][_0x19c2('0x39')](_0x19c2('0x3a'))){_0x5f1f0f[_0x19c2('0x20')]=qs['limit'](_0x58d51b[_0x19c2('0x33')][_0x19c2('0x20')]);_0x5f1f0f[_0x19c2('0x1f')]=qs[_0x19c2('0x1f')](_0x58d51b[_0x19c2('0x33')][_0x19c2('0x1f')]);}_0x5f1f0f[_0x19c2('0x3b')]=qs[_0x19c2('0x3c')](_0x58d51b[_0x19c2('0x33')]['sort']);_0x5f1f0f[_0x19c2('0x3d')]=qs[_0x19c2('0x34')](_[_0x19c2('0x3e')](_0x58d51b[_0x19c2('0x33')],_0x4f6c72[_0x19c2('0x34')]),_0x5e44cf);if(_0x58d51b[_0x19c2('0x33')][_0x19c2('0x3f')]){_0x5f1f0f[_0x19c2('0x3d')]=_[_0x19c2('0x40')](_0x5f1f0f[_0x19c2('0x3d')],{'$or':_[_0x19c2('0x2c')](_0x5e44cf,function(_0x3f21da){if(_0x3f21da[_0x19c2('0x30')]!==_0x19c2('0x41')){var _0x39accb={};_0x39accb[_0x3f21da[_0x19c2('0x29')]]={'$like':'%'+_0x58d51b[_0x19c2('0x33')]['filter']+'%'};return _0x39accb;}})});}_0x5f1f0f=_['merge']({},_0x5f1f0f,_0x58d51b[_0x19c2('0x42')]);var _0x55722a={'where':_0x5f1f0f['where']};return db['AnalyticTreeReport'][_0x19c2('0x1e')](_0x55722a)[_0x19c2('0x26')](function(_0x3622e2){_0x59790b['count']=_0x3622e2;if(_0x58d51b[_0x19c2('0x33')][_0x19c2('0x43')]){_0x5f1f0f['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x19c2('0x44')](_0x5f1f0f);})[_0x19c2('0x26')](function(_0x4cba6a){_0x59790b[_0x19c2('0x45')]=_0x4cba6a;return _0x59790b;})[_0x19c2('0x26')](respondWithFilteredResult(_0x4cbc3c,_0x5f1f0f))['catch'](handleError(_0x4cbc3c,null));};exports['show']=function(_0x14a328,_0x2fcf6b){var _0x1ddcd7={'raw':!![],'where':{'id':_0x14a328[_0x19c2('0x46')]['id']}},_0x15bbb2={};_0x15bbb2[_0x19c2('0x32')]=_[_0x19c2('0x47')](db['AnalyticTreeReport']['rawAttributes']);_0x15bbb2['query']=_[_0x19c2('0x47')](_0x14a328[_0x19c2('0x33')]);_0x15bbb2[_0x19c2('0x34')]=_['intersection'](_0x15bbb2[_0x19c2('0x32')],_0x15bbb2['query']);_0x1ddcd7[_0x19c2('0x35')]=_['intersection'](_0x15bbb2[_0x19c2('0x32')],qs['fields'](_0x14a328[_0x19c2('0x33')]['fields']));_0x1ddcd7[_0x19c2('0x35')]=_0x1ddcd7[_0x19c2('0x35')][_0x19c2('0x38')]?_0x1ddcd7['attributes']:_0x15bbb2['model'];if(_0x14a328[_0x19c2('0x33')]['includeAll']){_0x1ddcd7[_0x19c2('0x48')]=[{'all':!![]}];}_0x1ddcd7=_[_0x19c2('0x40')]({},_0x1ddcd7,_0x14a328['options']);return db[_0x19c2('0x2d')]['find'](_0x1ddcd7)['then'](handleEntityNotFound(_0x2fcf6b,null))[_0x19c2('0x26')](respondWithResult(_0x2fcf6b,null))[_0x19c2('0x49')](handleError(_0x2fcf6b,null));};exports[_0x19c2('0x4a')]=function(_0x50d60a,_0x1e3f5a){return db[_0x19c2('0x2d')][_0x19c2('0x4a')](_0x50d60a[_0x19c2('0x4b')],{})[_0x19c2('0x26')](respondWithResult(_0x1e3f5a,0xc9))['catch'](handleError(_0x1e3f5a,null));};exports[_0x19c2('0x24')]=function(_0x2c82b4,_0x27ad7f){if(_0x2c82b4[_0x19c2('0x4b')]['id']){delete _0x2c82b4[_0x19c2('0x4b')]['id'];}return db['AnalyticTreeReport'][_0x19c2('0x4c')]({'where':{'id':_0x2c82b4[_0x19c2('0x46')]['id']}})[_0x19c2('0x26')](handleEntityNotFound(_0x27ad7f,null))['then'](saveUpdates(_0x2c82b4['body'],null))[_0x19c2('0x26')](respondWithResult(_0x27ad7f,null))[_0x19c2('0x49')](handleError(_0x27ad7f,null));};exports[_0x19c2('0x25')]=function(_0x2658e6,_0x403259){return db[_0x19c2('0x2d')][_0x19c2('0x4c')]({'where':{'id':_0x2658e6[_0x19c2('0x46')]['id']}})['then'](handleEntityNotFound(_0x403259,null))[_0x19c2('0x26')](removeEntity(_0x403259,null))['catch'](handleError(_0x403259,null));};
\ No newline at end of file
+var _0xa784=['reject','save','update','then','destroy','sendStatus','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','include','includeAll','options','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x2bea18,_0x4aee7d){var _0x1d5d79=function(_0x3af13f){while(--_0x3af13f){_0x2bea18['push'](_0x2bea18['shift']());}};_0x1d5d79(++_0x4aee7d);}(_0xa784,0x149));var _0x4a78=function(_0x5898d5,_0x316204){_0x5898d5=_0x5898d5-0x0;var _0x2b3c4e=_0xa784[_0x5898d5];return _0x2b3c4e;};'use strict';var emlformat=require(_0x4a78('0x0'));var rimraf=require(_0x4a78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a78('0x2'));var rp=require('request-promise');var moment=require(_0x4a78('0x3'));var BPromise=require(_0x4a78('0x4'));var Mustache=require(_0x4a78('0x5'));var util=require(_0x4a78('0x6'));var path=require(_0x4a78('0x7'));var sox=require(_0x4a78('0x8'));var csv=require(_0x4a78('0x9'));var ejs=require(_0x4a78('0xa'));var fs=require('fs');var fs_extra=require(_0x4a78('0xb'));var _=require(_0x4a78('0xc'));var squel=require(_0x4a78('0xd'));var crypto=require(_0x4a78('0xe'));var jsforce=require(_0x4a78('0xf'));var deskjs=require(_0x4a78('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4a78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4a78('0x12'));var as=require(_0x4a78('0x13'));var hardwareService=require(_0x4a78('0x14'));var logger=require(_0x4a78('0x15'))(_0x4a78('0x16'));var utils=require('../../config/utils');var config=require(_0x4a78('0x17'));var licenseUtil=require(_0x4a78('0x18'));var db=require(_0x4a78('0x19'))['db'];function respondWithStatusCode(_0x25f65b,_0x2eaf72){_0x2eaf72=_0x2eaf72||0xcc;return function(_0xfa8ff3){if(_0xfa8ff3){return _0x25f65b['sendStatus'](_0x2eaf72);}return _0x25f65b['status'](_0x2eaf72)[_0x4a78('0x1a')]();};}function respondWithResult(_0x1fa64e,_0x2686dd){_0x2686dd=_0x2686dd||0xc8;return function(_0x384964){if(_0x384964){return _0x1fa64e[_0x4a78('0x1b')](_0x2686dd)[_0x4a78('0x1c')](_0x384964);}};}function respondWithFilteredResult(_0x90a53e,_0x2dd995){return function(_0x564fdd){if(_0x564fdd){var _0xaba8eb=typeof _0x2dd995[_0x4a78('0x1d')]===_0x4a78('0x1e')&&typeof _0x2dd995['limit']===_0x4a78('0x1e');var _0x272b0e=_0x564fdd[_0x4a78('0x1f')];var _0x3796da=_0xaba8eb?0x0:_0x2dd995[_0x4a78('0x1d')];var _0x5c7ae8=_0xaba8eb?_0x564fdd['count']:_0x2dd995['offset']+_0x2dd995[_0x4a78('0x20')];var _0x947a0;if(_0x5c7ae8>=_0x272b0e){_0x5c7ae8=_0x272b0e;_0x947a0=0xc8;}else{_0x947a0=0xce;}_0x90a53e['status'](_0x947a0);return _0x90a53e[_0x4a78('0x21')](_0x4a78('0x22'),_0x3796da+'-'+_0x5c7ae8+'/'+_0x272b0e)[_0x4a78('0x1c')](_0x564fdd);}return null;};}function patchUpdates(_0x453d3b){return function(_0xe181fc){try{jsonpatch[_0x4a78('0x23')](_0xe181fc,_0x453d3b,!![]);}catch(_0x3c09ab){return BPromise[_0x4a78('0x24')](_0x3c09ab);}return _0xe181fc[_0x4a78('0x25')]();};}function saveUpdates(_0x1e15c0,_0x42d77d){return function(_0x1ba18c){if(_0x1ba18c){return _0x1ba18c[_0x4a78('0x26')](_0x1e15c0)[_0x4a78('0x27')](function(_0x1f6079){return _0x1f6079;});}return null;};}function removeEntity(_0x5e1314,_0x26dfe7){return function(_0x2f7019){if(_0x2f7019){return _0x2f7019[_0x4a78('0x28')]()[_0x4a78('0x27')](function(){_0x5e1314[_0x4a78('0x1b')](0xcc)[_0x4a78('0x1a')]();});}};}function handleEntityNotFound(_0x366a1f,_0x1011bf){return function(_0xe5c85e){if(!_0xe5c85e){_0x366a1f[_0x4a78('0x29')](0x194);}return _0xe5c85e;};}function handleError(_0x3f8925,_0x56d7f7){_0x56d7f7=_0x56d7f7||0x1f4;return function(_0x3c9985){logger['error'](_0x3c9985[_0x4a78('0x2a')]);if(_0x3c9985[_0x4a78('0x2b')]){delete _0x3c9985['name'];}_0x3f8925[_0x4a78('0x1b')](_0x56d7f7)[_0x4a78('0x2c')](_0x3c9985);};}exports['index']=function(_0x4ce339,_0x12ae8c){var _0x43f3ab={},_0x218202={},_0x550d83={'count':0x0,'rows':[]};var _0x2b856c=_[_0x4a78('0x2d')](db[_0x4a78('0x2e')][_0x4a78('0x2f')],function(_0x4693ac){return{'name':_0x4693ac[_0x4a78('0x30')],'type':_0x4693ac[_0x4a78('0x31')][_0x4a78('0x32')]};});_0x218202[_0x4a78('0x33')]=_['map'](_0x2b856c,_0x4a78('0x2b'));_0x218202[_0x4a78('0x34')]=_[_0x4a78('0x35')](_0x4ce339[_0x4a78('0x34')]);_0x218202[_0x4a78('0x36')]=_[_0x4a78('0x37')](_0x218202['model'],_0x218202[_0x4a78('0x34')]);_0x43f3ab[_0x4a78('0x38')]=_[_0x4a78('0x37')](_0x218202[_0x4a78('0x33')],qs[_0x4a78('0x39')](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x39')]));_0x43f3ab[_0x4a78('0x38')]=_0x43f3ab['attributes'][_0x4a78('0x3a')]?_0x43f3ab[_0x4a78('0x38')]:_0x218202['model'];if(!_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3b')]('nolimit')){_0x43f3ab[_0x4a78('0x20')]=qs['limit'](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x20')]);_0x43f3ab[_0x4a78('0x1d')]=qs['offset'](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x1d')]);}_0x43f3ab[_0x4a78('0x3c')]=qs[_0x4a78('0x3d')](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3d')]);_0x43f3ab[_0x4a78('0x3e')]=qs['filters'](_['pick'](_0x4ce339['query'],_0x218202['filters']),_0x2b856c);if(_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3f')]){_0x43f3ab[_0x4a78('0x3e')]=_[_0x4a78('0x40')](_0x43f3ab[_0x4a78('0x3e')],{'$or':_[_0x4a78('0x2d')](_0x2b856c,function(_0x2a4af6){if(_0x2a4af6[_0x4a78('0x31')]!=='VIRTUAL'){var _0x1ec030={};_0x1ec030[_0x2a4af6[_0x4a78('0x2b')]]={'$like':'%'+_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3f')]+'%'};return _0x1ec030;}})});}_0x43f3ab=_[_0x4a78('0x40')]({},_0x43f3ab,_0x4ce339['options']);var _0xf6fac6={'where':_0x43f3ab[_0x4a78('0x3e')]};return db[_0x4a78('0x2e')][_0x4a78('0x1f')](_0xf6fac6)[_0x4a78('0x27')](function(_0x5a28b0){_0x550d83['count']=_0x5a28b0;if(_0x4ce339[_0x4a78('0x34')]['includeAll']){_0x43f3ab[_0x4a78('0x41')]=[{'all':!![]}];}return db[_0x4a78('0x2e')]['findAll'](_0x43f3ab);})[_0x4a78('0x27')](function(_0xc54919){_0x550d83['rows']=_0xc54919;return _0x550d83;})[_0x4a78('0x27')](respondWithFilteredResult(_0x12ae8c,_0x43f3ab))['catch'](handleError(_0x12ae8c,null));};exports['show']=function(_0x1a9bd2,_0x2ac901){var _0x31bfdf={'raw':!![],'where':{'id':_0x1a9bd2['params']['id']}},_0x1a89cd={};_0x1a89cd[_0x4a78('0x33')]=_['keys'](db[_0x4a78('0x2e')][_0x4a78('0x2f')]);_0x1a89cd[_0x4a78('0x34')]=_[_0x4a78('0x35')](_0x1a9bd2[_0x4a78('0x34')]);_0x1a89cd[_0x4a78('0x36')]=_[_0x4a78('0x37')](_0x1a89cd[_0x4a78('0x33')],_0x1a89cd[_0x4a78('0x34')]);_0x31bfdf['attributes']=_[_0x4a78('0x37')](_0x1a89cd[_0x4a78('0x33')],qs[_0x4a78('0x39')](_0x1a9bd2['query'][_0x4a78('0x39')]));_0x31bfdf[_0x4a78('0x38')]=_0x31bfdf[_0x4a78('0x38')][_0x4a78('0x3a')]?_0x31bfdf[_0x4a78('0x38')]:_0x1a89cd[_0x4a78('0x33')];if(_0x1a9bd2[_0x4a78('0x34')][_0x4a78('0x42')]){_0x31bfdf[_0x4a78('0x41')]=[{'all':!![]}];}_0x31bfdf=_[_0x4a78('0x40')]({},_0x31bfdf,_0x1a9bd2[_0x4a78('0x43')]);return db[_0x4a78('0x2e')][_0x4a78('0x44')](_0x31bfdf)[_0x4a78('0x27')](handleEntityNotFound(_0x2ac901,null))[_0x4a78('0x27')](respondWithResult(_0x2ac901,null))[_0x4a78('0x45')](handleError(_0x2ac901,null));};exports[_0x4a78('0x46')]=function(_0x174133,_0x1a4d1f){return db['AnalyticTreeReport'][_0x4a78('0x46')](_0x174133[_0x4a78('0x47')],{})['then'](respondWithResult(_0x1a4d1f,0xc9))[_0x4a78('0x45')](handleError(_0x1a4d1f,null));};exports[_0x4a78('0x26')]=function(_0x5df4bc,_0x5c5e05){if(_0x5df4bc[_0x4a78('0x47')]['id']){delete _0x5df4bc['body']['id'];}return db[_0x4a78('0x2e')][_0x4a78('0x44')]({'where':{'id':_0x5df4bc['params']['id']}})['then'](handleEntityNotFound(_0x5c5e05,null))[_0x4a78('0x27')](saveUpdates(_0x5df4bc[_0x4a78('0x47')],null))[_0x4a78('0x27')](respondWithResult(_0x5c5e05,null))[_0x4a78('0x45')](handleError(_0x5c5e05,null));};exports['destroy']=function(_0x2d96e7,_0x264751){return db[_0x4a78('0x2e')][_0x4a78('0x44')]({'where':{'id':_0x2d96e7[_0x4a78('0x48')]['id']}})['then'](handleEntityNotFound(_0x264751,null))[_0x4a78('0x27')](removeEntity(_0x264751,null))[_0x4a78('0x45')](handleError(_0x264751,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 90314b9..ce46b89 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 _0x1eba=['request-promise','path','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x598a3d,_0x3728b8){var _0x303e9e=function(_0x2fca75){while(--_0x2fca75){_0x598a3d['push'](_0x598a3d['shift']());}};_0x303e9e(++_0x3728b8);}(_0x1eba,0x132));var _0xa1eb=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x1eba[_0x460150];return _0x340677;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require(_0xa1eb('0x5'));var rp=require(_0xa1eb('0x6'));var fs=require('fs');var path=require(_0xa1eb('0x7'));var rimraf=require('rimraf');var config=require(_0xa1eb('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0xa1eb('0x9')]=function(_0x5c912b,_0x14d519){return _0x5c912b[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd68=['analytics_report_trees','util','../../config/logger','api','moment','bluebird','path','rimraf','define','AnalyticTreeReport'];(function(_0x2c505a,_0x3f7365){var _0x436bfb=function(_0x5863dc){while(--_0x5863dc){_0x2c505a['push'](_0x2c505a['shift']());}};_0x436bfb(++_0x3f7365);}(_0xdd68,0x119));var _0x8dd6=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xdd68[_0xee3051];return _0x139e81;};'use strict';var _=require('lodash');var util=require(_0x8dd6('0x0'));var logger=require(_0x8dd6('0x1'))(_0x8dd6('0x2'));var moment=require(_0x8dd6('0x3'));var BPromise=require(_0x8dd6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dd6('0x5'));var rimraf=require(_0x8dd6('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x20580a,_0x331c3c){return _0x20580a[_0x8dd6('0x7')](_0x8dd6('0x8'),attributes,{'tableName':_0x8dd6('0x9'),'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 b690c8f..c9b6b0e 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3cf964,_0x50417c){var _0x13581e=function(_0x36bf73){while(--_0x36bf73){_0x3cf964['push'](_0x3cf964['shift']());}};_0x13581e(++_0x50417c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ab638,_0x43c800){_0x1ab638=_0x1ab638-0x0;var _0x169e3d=_0x5f2f[_0x1ab638];return _0x169e3d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x398dd5,_0x2c8907){_0x398dd5=_0x398dd5-0x0;var _0x4f8b53=_0x7a54[_0x398dd5];return _0x4f8b53;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 038efc1..8e6b97f 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 _0xda89=['/:id','show','create','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xda89,0x19e));var _0x9da8=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xda89[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x9da8('0x0'));var util=require(_0x9da8('0x1'));var path=require('path');var timeout=require(_0x9da8('0x2'));var express=require(_0x9da8('0x3'));var router=express['Router']();var fs_extra=require(_0x9da8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9da8('0x5'));var config=require(_0x9da8('0x6'));var controller=require(_0x9da8('0x7'));router[_0x9da8('0x8')]('/',auth[_0x9da8('0x9')](),controller[_0x9da8('0xa')]);router[_0x9da8('0x8')](_0x9da8('0xb'),auth['isAuthenticated'](),controller[_0x9da8('0xc')]);router['post']('/',auth[_0x9da8('0x9')](),controller[_0x9da8('0xd')]);router['put'](_0x9da8('0xb'),auth[_0x9da8('0x9')](),controller[_0x9da8('0xe')]);router[_0x9da8('0xf')]('/:id',auth[_0x9da8('0x9')](),controller['destroy']);module[_0x9da8('0x10')]=router;
\ No newline at end of file
+var _0x9f6f=['post','create','put','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','index','get','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f6f,0x1a4));var _0xf9f6=function(_0x1af82a,_0x57001c){_0x1af82a=_0x1af82a-0x0;var _0x37220d=_0x9f6f[_0x1af82a];return _0x37220d;};'use strict';var multer=require(_0xf9f6('0x0'));var util=require(_0xf9f6('0x1'));var path=require('path');var timeout=require(_0xf9f6('0x2'));var express=require(_0xf9f6('0x3'));var router=express[_0xf9f6('0x4')]();var fs_extra=require(_0xf9f6('0x5'));var auth=require(_0xf9f6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf9f6('0x7')]);router[_0xf9f6('0x8')](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller[_0xf9f6('0xb')]);router[_0xf9f6('0xc')]('/',auth['isAuthenticated'](),controller[_0xf9f6('0xd')]);router[_0xf9f6('0xe')](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller[_0xf9f6('0xf')]);router['delete'](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 30f6d73..41abb77 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 _0xdfcc=['sequelize','exports','STRING'];(function(_0x53f6d4,_0xa61cc2){var _0x5d9a2d=function(_0x6fc0fa){while(--_0x6fc0fa){_0x53f6d4['push'](_0x53f6d4['shift']());}};_0x5d9a2d(++_0xa61cc2);}(_0xdfcc,0x8d));var _0xcdfc=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0xdfcc[_0x34bc6c];return _0x168820;};'use strict';var Sequelize=require(_0xcdfc('0x0'));module[_0xcdfc('0x1')]={'name':{'type':Sequelize[_0xcdfc('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcdfc('0x2')]}};
\ No newline at end of file
+var _0x864a=['sequelize','exports','STRING'];(function(_0x4b72f7,_0x5bc45d){var _0x4f3fb0=function(_0x44762e){while(--_0x44762e){_0x4b72f7['push'](_0x4b72f7['shift']());}};_0x4f3fb0(++_0x5bc45d);}(_0x864a,0x8a));var _0xa864=function(_0x274887,_0x929096){_0x274887=_0x274887-0x0;var _0x2c992e=_0x864a[_0x274887];return _0x2c992e;};'use strict';var Sequelize=require(_0xa864('0x0'));module[_0xa864('0x1')]={'name':{'type':Sequelize[_0xa864('0x2')]},'basename':{'type':Sequelize[_0xa864('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 69818f4..d8d66ec 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 _0x60be=['get','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','keys','include','options','find'];(function(_0x366fb4,_0x397abd){var _0x352234=function(_0x21f574){while(--_0x21f574){_0x366fb4['push'](_0x366fb4['shift']());}};_0x352234(++_0x397abd);}(_0x60be,0x1d0));var _0xe60b=function(_0x3005a6,_0x320826){_0x3005a6=_0x3005a6-0x0;var _0x2f7399=_0x60be[_0x3005a6];return _0x2f7399;};'use strict';var emlformat=require(_0xe60b('0x0'));var rimraf=require(_0xe60b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe60b('0x2'));var rp=require(_0xe60b('0x3'));var moment=require(_0xe60b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe60b('0x5'));var util=require(_0xe60b('0x6'));var path=require(_0xe60b('0x7'));var sox=require(_0xe60b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe60b('0x9'));var _=require(_0xe60b('0xa'));var squel=require('squel');var crypto=require(_0xe60b('0xb'));var jsforce=require(_0xe60b('0xc'));var deskjs=require(_0xe60b('0xd'));var toCsv=require(_0xe60b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe60b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe60b('0x10'));var hardwareService=require(_0xe60b('0x11'));var logger=require(_0xe60b('0x12'))('api');var utils=require(_0xe60b('0x13'));var config=require(_0xe60b('0x14'));var licenseUtil=require(_0xe60b('0x15'));var db=require(_0xe60b('0x16'))['db'];function respondWithStatusCode(_0x452782,_0xc33cd3){_0xc33cd3=_0xc33cd3||0xcc;return function(_0x4b8fa3){if(_0x4b8fa3){return _0x452782[_0xe60b('0x17')](_0xc33cd3);}return _0x452782[_0xe60b('0x18')](_0xc33cd3)[_0xe60b('0x19')]();};}function respondWithResult(_0x5adbdd,_0x3efe6b){_0x3efe6b=_0x3efe6b||0xc8;return function(_0x5ccf7a){if(_0x5ccf7a){return _0x5adbdd[_0xe60b('0x18')](_0x3efe6b)[_0xe60b('0x1a')](_0x5ccf7a);}};}function respondWithFilteredResult(_0x4af477,_0x347874){return function(_0x291e4c){if(_0x291e4c){var _0x3eb74e=typeof _0x347874[_0xe60b('0x1b')]==='undefined'&&typeof _0x347874[_0xe60b('0x1c')]===_0xe60b('0x1d');var _0x5e8eb5=_0x291e4c[_0xe60b('0x1e')];var _0x1c9481=_0x3eb74e?0x0:_0x347874[_0xe60b('0x1b')];var _0x51f709=_0x3eb74e?_0x291e4c['count']:_0x347874['offset']+_0x347874[_0xe60b('0x1c')];var _0x5566e4;if(_0x51f709>=_0x5e8eb5){_0x51f709=_0x5e8eb5;_0x5566e4=0xc8;}else{_0x5566e4=0xce;}_0x4af477['status'](_0x5566e4);return _0x4af477[_0xe60b('0x1f')](_0xe60b('0x20'),_0x1c9481+'-'+_0x51f709+'/'+_0x5e8eb5)[_0xe60b('0x1a')](_0x291e4c);}return null;};}function patchUpdates(_0x56558d){return function(_0x21cc96){try{jsonpatch['apply'](_0x21cc96,_0x56558d,!![]);}catch(_0x19f784){return BPromise[_0xe60b('0x21')](_0x19f784);}return _0x21cc96[_0xe60b('0x22')]();};}function saveUpdates(_0xb2c8d9,_0x1955d5){return function(_0x4c75e7){if(_0x4c75e7){return _0x4c75e7['update'](_0xb2c8d9)[_0xe60b('0x23')](function(_0x2a0a9f){return _0x2a0a9f;});}return null;};}function removeEntity(_0x2562d1,_0x512401){return function(_0x408ba9){if(_0x408ba9){return _0x408ba9['destroy']()[_0xe60b('0x23')](function(){_0x2562d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa15c8a,_0x44f332){return function(_0x1519ce){if(!_0x1519ce){_0xa15c8a[_0xe60b('0x17')](0x194);}return _0x1519ce;};}function handleError(_0x27cebb,_0x1715b6){_0x1715b6=_0x1715b6||0x1f4;return function(_0x18426f){logger[_0xe60b('0x24')](_0x18426f[_0xe60b('0x25')]);if(_0x18426f[_0xe60b('0x26')]){delete _0x18426f[_0xe60b('0x26')];}_0x27cebb[_0xe60b('0x18')](_0x1715b6)[_0xe60b('0x27')](_0x18426f);};}exports[_0xe60b('0x28')]=function(_0x298e99,_0xf13d92){var _0xa6c9e7={},_0x3789dd={},_0x551922={'count':0x0,'rows':[]};var _0x287204=_[_0xe60b('0x29')](db[_0xe60b('0x2a')][_0xe60b('0x2b')],function(_0x37f439){return{'name':_0x37f439[_0xe60b('0x2c')],'type':_0x37f439[_0xe60b('0x2d')][_0xe60b('0x2e')]};});_0x3789dd[_0xe60b('0x2f')]=_[_0xe60b('0x29')](_0x287204,_0xe60b('0x26'));_0x3789dd[_0xe60b('0x30')]=_['keys'](_0x298e99[_0xe60b('0x30')]);_0x3789dd[_0xe60b('0x31')]=_[_0xe60b('0x32')](_0x3789dd[_0xe60b('0x2f')],_0x3789dd[_0xe60b('0x30')]);_0xa6c9e7['attributes']=_[_0xe60b('0x32')](_0x3789dd['model'],qs[_0xe60b('0x33')](_0x298e99[_0xe60b('0x30')][_0xe60b('0x33')]));_0xa6c9e7[_0xe60b('0x34')]=_0xa6c9e7[_0xe60b('0x34')][_0xe60b('0x35')]?_0xa6c9e7['attributes']:_0x3789dd[_0xe60b('0x2f')];if(!_0x298e99[_0xe60b('0x30')][_0xe60b('0x36')](_0xe60b('0x37'))){_0xa6c9e7[_0xe60b('0x1c')]=qs[_0xe60b('0x1c')](_0x298e99[_0xe60b('0x30')]['limit']);_0xa6c9e7[_0xe60b('0x1b')]=qs[_0xe60b('0x1b')](_0x298e99[_0xe60b('0x30')][_0xe60b('0x1b')]);}_0xa6c9e7[_0xe60b('0x38')]=qs['sort'](_0x298e99[_0xe60b('0x30')]['sort']);_0xa6c9e7[_0xe60b('0x39')]=qs['filters'](_[_0xe60b('0x3a')](_0x298e99[_0xe60b('0x30')],_0x3789dd[_0xe60b('0x31')]),_0x287204);if(_0x298e99[_0xe60b('0x30')][_0xe60b('0x3b')]){_0xa6c9e7['where']=_[_0xe60b('0x3c')](_0xa6c9e7[_0xe60b('0x39')],{'$or':_[_0xe60b('0x29')](_0x287204,function(_0x1d9daa){if(_0x1d9daa[_0xe60b('0x2d')]!==_0xe60b('0x3d')){var _0x523e5a={};_0x523e5a[_0x1d9daa['name']]={'$like':'%'+_0x298e99[_0xe60b('0x30')][_0xe60b('0x3b')]+'%'};return _0x523e5a;}})});}_0xa6c9e7=_[_0xe60b('0x3c')]({},_0xa6c9e7,_0x298e99['options']);var _0x8da81c={'where':_0xa6c9e7[_0xe60b('0x39')]};return db['Attachment']['count'](_0x8da81c)[_0xe60b('0x23')](function(_0x565d09){_0x551922[_0xe60b('0x1e')]=_0x565d09;if(_0x298e99['query'][_0xe60b('0x3e')]){_0xa6c9e7['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0xa6c9e7);})[_0xe60b('0x23')](function(_0x7b88a9){_0x551922[_0xe60b('0x3f')]=_0x7b88a9;return _0x551922;})[_0xe60b('0x23')](respondWithFilteredResult(_0xf13d92,_0xa6c9e7))[_0xe60b('0x40')](handleError(_0xf13d92,null));};exports['show']=function(_0x411de8,_0x399886){var _0x4829c8={'raw':!![],'where':{'id':_0x411de8[_0xe60b('0x41')]['id']}},_0x1881b5={};_0x1881b5[_0xe60b('0x2f')]=_[_0xe60b('0x42')](db[_0xe60b('0x2a')][_0xe60b('0x2b')]);_0x1881b5[_0xe60b('0x30')]=_['keys'](_0x411de8[_0xe60b('0x30')]);_0x1881b5['filters']=_[_0xe60b('0x32')](_0x1881b5[_0xe60b('0x2f')],_0x1881b5[_0xe60b('0x30')]);_0x4829c8['attributes']=_[_0xe60b('0x32')](_0x1881b5['model'],qs[_0xe60b('0x33')](_0x411de8[_0xe60b('0x30')][_0xe60b('0x33')]));_0x4829c8['attributes']=_0x4829c8[_0xe60b('0x34')]['length']?_0x4829c8[_0xe60b('0x34')]:_0x1881b5[_0xe60b('0x2f')];if(_0x411de8[_0xe60b('0x30')][_0xe60b('0x3e')]){_0x4829c8[_0xe60b('0x43')]=[{'all':!![]}];}_0x4829c8=_['merge']({},_0x4829c8,_0x411de8[_0xe60b('0x44')]);return db[_0xe60b('0x2a')][_0xe60b('0x45')](_0x4829c8)[_0xe60b('0x23')](handleEntityNotFound(_0x399886,null))[_0xe60b('0x23')](respondWithResult(_0x399886,null))['catch'](handleError(_0x399886,null));};exports['clone']=function(_0x110ec3,_0x2ae69f){var _0x1c1968={'where':{'id':_0x110ec3[_0xe60b('0x41')]['id']}},_0x5ecc76={};_0x5ecc76[_0xe60b('0x2f')]=_['keys'](db[_0xe60b('0x2a')][_0xe60b('0x2b')]);_0x1c1968['attributes']=_[_0xe60b('0x32')](_0x5ecc76[_0xe60b('0x2f')],qs['fields'](_0x110ec3['query'][_0xe60b('0x33')]));_0x1c1968[_0xe60b('0x34')]=_0x1c1968['attributes'][_0xe60b('0x35')]?_0x1c1968[_0xe60b('0x34')]:_0x5ecc76[_0xe60b('0x2f')];if(_0x110ec3[_0xe60b('0x30')]['includeAll']){_0x1c1968[_0xe60b('0x43')]=[{'all':!![]}];}_0x1c1968=_[_0xe60b('0x3c')]({},_0x1c1968,_0x110ec3[_0xe60b('0x44')]);return db[_0xe60b('0x2a')][_0xe60b('0x45')](_0x1c1968)['then'](handleEntityNotFound(_0x2ae69f,null))[_0xe60b('0x23')](function(_0x3c2253){if(_0x3c2253){var _0x31f5f6=_0x3c2253[_0xe60b('0x46')]({'plain':!![]});_0x31f5f6=qs[_0xe60b('0x47')](_0x31f5f6,['id',_0xe60b('0x48'),_0xe60b('0x49')]);_0x110ec3[_0xe60b('0x4a')]=_[_0xe60b('0x47')](_0x110ec3[_0xe60b('0x4a')],['id',_0xe60b('0x48'),_0xe60b('0x49')]);return db[_0xe60b('0x2a')]['create'](_[_0xe60b('0x3c')](_0x31f5f6,_0x110ec3[_0xe60b('0x4a')]),{'include':_0x110ec3[_0xe60b('0x30')][_0xe60b('0x3e')]?[{'all':!![]}]:undefined});}})[_0xe60b('0x23')](respondWithResult(_0x2ae69f,0xc9))[_0xe60b('0x40')](handleError(_0x2ae69f,null));};exports[_0xe60b('0x4b')]=function(_0x59e4fd,_0x44e324){if(_0x59e4fd[_0xe60b('0x4a')]['id']){delete _0x59e4fd[_0xe60b('0x4a')]['id'];}return db[_0xe60b('0x2a')][_0xe60b('0x45')]({'where':{'id':_0x59e4fd[_0xe60b('0x41')]['id']}})[_0xe60b('0x23')](handleEntityNotFound(_0x44e324,null))[_0xe60b('0x23')](saveUpdates(_0x59e4fd['body'],null))[_0xe60b('0x23')](respondWithResult(_0x44e324,null))[_0xe60b('0x40')](handleError(_0x44e324,null));};exports['destroy']=function(_0x46f330,_0x3f9a2b){return db['Attachment'][_0xe60b('0x45')]({'where':{'id':_0x46f330[_0xe60b('0x41')]['id']}})['then'](handleEntityNotFound(_0x3f9a2b,null))['then'](removeEntity(_0x3f9a2b,null))[_0xe60b('0x40')](handleError(_0x3f9a2b,null));};exports[_0xe60b('0x4c')]=function(_0x4f2ad5,_0x50017e,_0x17383e){_0x4f2ad5[_0xe60b('0x4a')][_0xe60b('0x26')]=_0x4f2ad5[_0xe60b('0x4d')][_0xe60b('0x4e')];_0x4f2ad5['body'][_0xe60b('0x4f')]=_0x4f2ad5[_0xe60b('0x4d')][_0xe60b('0x50')];_0x4f2ad5['body'][_0xe60b('0x2d')]=_0x4f2ad5[_0xe60b('0x4d')][_0xe60b('0x51')];return db[_0xe60b('0x2a')][_0xe60b('0x4c')](_0x4f2ad5['body'])[_0xe60b('0x23')](respondWithResult(_0x50017e,0xc9))[_0xe60b('0x40')](handleError(_0x50017e,null));};exports[_0xe60b('0x52')]=function(_0x3490bd,_0x148c9a,_0x42ef5c){return db[_0xe60b('0x2a')][_0xe60b('0x53')]({'where':{'id':_0x3490bd[_0xe60b('0x41')]['id']},'raw':!![]})[_0xe60b('0x23')](handleEntityNotFound(_0x148c9a,null))['then'](function(_0x299a14){if(_0x299a14){var _0x159c00=_0x299a14[_0xe60b('0x54')]!==null;var _0x336611=path[_0xe60b('0x55')](config[_0xe60b('0x56')],_0xe60b('0x57'));if(_0x159c00){_0x336611=path[_0xe60b('0x55')](_0x336611,_0xe60b('0x58'));}var _0x541caa=path[_0xe60b('0x55')](_0x336611,_0x299a14['basename']);return _0x148c9a[_0xe60b('0x52')](_0x541caa);}})[_0xe60b('0x40')](handleError(_0x148c9a,null));};
\ No newline at end of file
+var _0x4d97=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','catch','get','omit','updatedAt','body','createdAt','file','filename','type','mimetype','create','download','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','rimraf','zip-dir','moment','mustache','util','path','ejs','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','Attachment','key','model','query','intersection','fields','attributes'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x4d97,0x77));var _0x74d9=function(_0xe64add,_0x513eec){_0xe64add=_0xe64add-0x0;var _0x3af097=_0x4d97[_0xe64add];return _0x3af097;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74d9('0x0'));var zipdir=require(_0x74d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x74d9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x74d9('0x3'));var util=require(_0x74d9('0x4'));var path=require(_0x74d9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74d9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74d9('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x74d9('0x8'));var toCsv=require(_0x74d9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74d9('0xa'));var authService=require(_0x74d9('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x74d9('0xc'));var hardwareService=require(_0x74d9('0xd'));var logger=require(_0x74d9('0xe'))(_0x74d9('0xf'));var utils=require(_0x74d9('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x74d9('0x11'));var db=require(_0x74d9('0x12'))['db'];function respondWithStatusCode(_0x8f6f40,_0x5aa494){_0x5aa494=_0x5aa494||0xcc;return function(_0x572614){if(_0x572614){return _0x8f6f40['sendStatus'](_0x5aa494);}return _0x8f6f40['status'](_0x5aa494)[_0x74d9('0x13')]();};}function respondWithResult(_0xc92a25,_0x2a72b5){_0x2a72b5=_0x2a72b5||0xc8;return function(_0x2d238a){if(_0x2d238a){return _0xc92a25[_0x74d9('0x14')](_0x2a72b5)['json'](_0x2d238a);}};}function respondWithFilteredResult(_0x53aaa7,_0x350596){return function(_0x4a04fe){if(_0x4a04fe){var _0x8c01ef=typeof _0x350596['offset']===_0x74d9('0x15')&&typeof _0x350596[_0x74d9('0x16')]===_0x74d9('0x15');var _0x33b47f=_0x4a04fe['count'];var _0x42a0d0=_0x8c01ef?0x0:_0x350596['offset'];var _0x44cca2=_0x8c01ef?_0x4a04fe[_0x74d9('0x17')]:_0x350596[_0x74d9('0x18')]+_0x350596['limit'];var _0x3cca66;if(_0x44cca2>=_0x33b47f){_0x44cca2=_0x33b47f;_0x3cca66=0xc8;}else{_0x3cca66=0xce;}_0x53aaa7['status'](_0x3cca66);return _0x53aaa7['set']('Content-Range',_0x42a0d0+'-'+_0x44cca2+'/'+_0x33b47f)[_0x74d9('0x19')](_0x4a04fe);}return null;};}function patchUpdates(_0x15d964){return function(_0x27d1ec){try{jsonpatch[_0x74d9('0x1a')](_0x27d1ec,_0x15d964,!![]);}catch(_0xcc45f6){return BPromise[_0x74d9('0x1b')](_0xcc45f6);}return _0x27d1ec[_0x74d9('0x1c')]();};}function saveUpdates(_0x1d81ba,_0x469c16){return function(_0xc56775){if(_0xc56775){return _0xc56775[_0x74d9('0x1d')](_0x1d81ba)[_0x74d9('0x1e')](function(_0x263cd0){return _0x263cd0;});}return null;};}function removeEntity(_0x3656c4,_0x5407ac){return function(_0x47bba7){if(_0x47bba7){return _0x47bba7['destroy']()[_0x74d9('0x1e')](function(){_0x3656c4['status'](0xcc)[_0x74d9('0x13')]();});}};}function handleEntityNotFound(_0x582e1a,_0x226d28){return function(_0x11554c){if(!_0x11554c){_0x582e1a[_0x74d9('0x1f')](0x194);}return _0x11554c;};}function handleError(_0x4d2255,_0x5371b7){_0x5371b7=_0x5371b7||0x1f4;return function(_0x1e5861){logger[_0x74d9('0x20')](_0x1e5861[_0x74d9('0x21')]);if(_0x1e5861[_0x74d9('0x22')]){delete _0x1e5861[_0x74d9('0x22')];}_0x4d2255[_0x74d9('0x14')](_0x5371b7)[_0x74d9('0x23')](_0x1e5861);};}exports[_0x74d9('0x24')]=function(_0x1f6db8,_0x265e92){var _0x5f3ac1={},_0x2075d0={},_0x553028={'count':0x0,'rows':[]};var _0x50f7d1=_[_0x74d9('0x25')](db[_0x74d9('0x26')]['rawAttributes'],function(_0x2e6a1c){return{'name':_0x2e6a1c['fieldName'],'type':_0x2e6a1c['type'][_0x74d9('0x27')]};});_0x2075d0[_0x74d9('0x28')]=_['map'](_0x50f7d1,_0x74d9('0x22'));_0x2075d0[_0x74d9('0x29')]=_['keys'](_0x1f6db8['query']);_0x2075d0['filters']=_[_0x74d9('0x2a')](_0x2075d0[_0x74d9('0x28')],_0x2075d0['query']);_0x5f3ac1['attributes']=_['intersection'](_0x2075d0[_0x74d9('0x28')],qs[_0x74d9('0x2b')](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x5f3ac1[_0x74d9('0x2c')]=_0x5f3ac1[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x5f3ac1[_0x74d9('0x2c')]:_0x2075d0[_0x74d9('0x28')];if(!_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x2e')](_0x74d9('0x2f'))){_0x5f3ac1['limit']=qs['limit'](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x16')]);_0x5f3ac1[_0x74d9('0x18')]=qs[_0x74d9('0x18')](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x18')]);}_0x5f3ac1[_0x74d9('0x30')]=qs[_0x74d9('0x31')](_0x1f6db8['query']['sort']);_0x5f3ac1[_0x74d9('0x32')]=qs[_0x74d9('0x33')](_[_0x74d9('0x34')](_0x1f6db8[_0x74d9('0x29')],_0x2075d0[_0x74d9('0x33')]),_0x50f7d1);if(_0x1f6db8[_0x74d9('0x29')]['filter']){_0x5f3ac1[_0x74d9('0x32')]=_['merge'](_0x5f3ac1['where'],{'$or':_[_0x74d9('0x25')](_0x50f7d1,function(_0x392630){if(_0x392630['type']!==_0x74d9('0x35')){var _0x14ed55={};_0x14ed55[_0x392630[_0x74d9('0x22')]]={'$like':'%'+_0x1f6db8[_0x74d9('0x29')]['filter']+'%'};return _0x14ed55;}})});}_0x5f3ac1=_[_0x74d9('0x36')]({},_0x5f3ac1,_0x1f6db8[_0x74d9('0x37')]);var _0x392b6d={'where':_0x5f3ac1[_0x74d9('0x32')]};return db[_0x74d9('0x26')][_0x74d9('0x17')](_0x392b6d)[_0x74d9('0x1e')](function(_0x1c42f4){_0x553028[_0x74d9('0x17')]=_0x1c42f4;if(_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x38')]){_0x5f3ac1['include']=[{'all':!![]}];}return db[_0x74d9('0x26')][_0x74d9('0x39')](_0x5f3ac1);})[_0x74d9('0x1e')](function(_0x4b424e){_0x553028[_0x74d9('0x3a')]=_0x4b424e;return _0x553028;})['then'](respondWithFilteredResult(_0x265e92,_0x5f3ac1))['catch'](handleError(_0x265e92,null));};exports[_0x74d9('0x3b')]=function(_0x41d6f7,_0x409717){var _0x3c1d15={'raw':!![],'where':{'id':_0x41d6f7[_0x74d9('0x3c')]['id']}},_0x526383={};_0x526383[_0x74d9('0x28')]=_[_0x74d9('0x3d')](db[_0x74d9('0x26')][_0x74d9('0x3e')]);_0x526383['query']=_[_0x74d9('0x3d')](_0x41d6f7[_0x74d9('0x29')]);_0x526383[_0x74d9('0x33')]=_['intersection'](_0x526383[_0x74d9('0x28')],_0x526383['query']);_0x3c1d15[_0x74d9('0x2c')]=_[_0x74d9('0x2a')](_0x526383['model'],qs['fields'](_0x41d6f7[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x3c1d15['attributes']=_0x3c1d15[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x3c1d15['attributes']:_0x526383[_0x74d9('0x28')];if(_0x41d6f7[_0x74d9('0x29')][_0x74d9('0x38')]){_0x3c1d15[_0x74d9('0x3f')]=[{'all':!![]}];}_0x3c1d15=_['merge']({},_0x3c1d15,_0x41d6f7[_0x74d9('0x37')]);return db['Attachment'][_0x74d9('0x40')](_0x3c1d15)[_0x74d9('0x1e')](handleEntityNotFound(_0x409717,null))[_0x74d9('0x1e')](respondWithResult(_0x409717,null))[_0x74d9('0x41')](handleError(_0x409717,null));};exports['clone']=function(_0x490fd3,_0x1dae36){var _0x5d9d9d={'where':{'id':_0x490fd3[_0x74d9('0x3c')]['id']}},_0x1d0671={};_0x1d0671['model']=_[_0x74d9('0x3d')](db[_0x74d9('0x26')]['rawAttributes']);_0x5d9d9d[_0x74d9('0x2c')]=_[_0x74d9('0x2a')](_0x1d0671[_0x74d9('0x28')],qs[_0x74d9('0x2b')](_0x490fd3[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x5d9d9d[_0x74d9('0x2c')]=_0x5d9d9d[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x5d9d9d[_0x74d9('0x2c')]:_0x1d0671[_0x74d9('0x28')];if(_0x490fd3[_0x74d9('0x29')][_0x74d9('0x38')]){_0x5d9d9d[_0x74d9('0x3f')]=[{'all':!![]}];}_0x5d9d9d=_['merge']({},_0x5d9d9d,_0x490fd3['options']);return db[_0x74d9('0x26')][_0x74d9('0x40')](_0x5d9d9d)[_0x74d9('0x1e')](handleEntityNotFound(_0x1dae36,null))[_0x74d9('0x1e')](function(_0x4cf085){if(_0x4cf085){var _0x5ce857=_0x4cf085[_0x74d9('0x42')]({'plain':!![]});_0x5ce857=qs[_0x74d9('0x43')](_0x5ce857,['id','createdAt',_0x74d9('0x44')]);_0x490fd3[_0x74d9('0x45')]=_[_0x74d9('0x43')](_0x490fd3[_0x74d9('0x45')],['id',_0x74d9('0x46'),_0x74d9('0x44')]);return db[_0x74d9('0x26')]['create'](_[_0x74d9('0x36')](_0x5ce857,_0x490fd3['body']),{'include':_0x490fd3[_0x74d9('0x29')][_0x74d9('0x38')]?[{'all':!![]}]:undefined});}})[_0x74d9('0x1e')](respondWithResult(_0x1dae36,0xc9))[_0x74d9('0x41')](handleError(_0x1dae36,null));};exports[_0x74d9('0x1d')]=function(_0x2c52cf,_0x45528f){if(_0x2c52cf[_0x74d9('0x45')]['id']){delete _0x2c52cf[_0x74d9('0x45')]['id'];}return db[_0x74d9('0x26')][_0x74d9('0x40')]({'where':{'id':_0x2c52cf[_0x74d9('0x3c')]['id']}})[_0x74d9('0x1e')](handleEntityNotFound(_0x45528f,null))[_0x74d9('0x1e')](saveUpdates(_0x2c52cf['body'],null))[_0x74d9('0x1e')](respondWithResult(_0x45528f,null))['catch'](handleError(_0x45528f,null));};exports['destroy']=function(_0x5357d8,_0x1376cd){return db[_0x74d9('0x26')][_0x74d9('0x40')]({'where':{'id':_0x5357d8[_0x74d9('0x3c')]['id']}})[_0x74d9('0x1e')](handleEntityNotFound(_0x1376cd,null))[_0x74d9('0x1e')](removeEntity(_0x1376cd,null))[_0x74d9('0x41')](handleError(_0x1376cd,null));};exports['create']=function(_0x4e154c,_0x59c977,_0x38f2e6){_0x4e154c[_0x74d9('0x45')]['name']=_0x4e154c['file']['originalname'];_0x4e154c[_0x74d9('0x45')]['basename']=_0x4e154c[_0x74d9('0x47')][_0x74d9('0x48')];_0x4e154c[_0x74d9('0x45')][_0x74d9('0x49')]=_0x4e154c[_0x74d9('0x47')][_0x74d9('0x4a')];return db[_0x74d9('0x26')][_0x74d9('0x4b')](_0x4e154c[_0x74d9('0x45')])[_0x74d9('0x1e')](respondWithResult(_0x59c977,0xc9))[_0x74d9('0x41')](handleError(_0x59c977,null));};exports[_0x74d9('0x4c')]=function(_0x570306,_0x5773d6,_0x12f6ff){return db[_0x74d9('0x26')]['findOne']({'where':{'id':_0x570306[_0x74d9('0x3c')]['id']},'raw':!![]})[_0x74d9('0x1e')](handleEntityNotFound(_0x5773d6,null))['then'](function(_0x38a770){if(_0x38a770){var _0x42e714=_0x38a770[_0x74d9('0x4d')]!==null;var _0x1e623e=path[_0x74d9('0x4e')](config['root'],_0x74d9('0x4f'));if(_0x42e714){_0x1e623e=path[_0x74d9('0x4e')](_0x1e623e,_0x74d9('0x50'));}var _0x2a88f9=path['join'](_0x1e623e,_0x38a770[_0x74d9('0x51')]);return _0x5773d6[_0x74d9('0x4c')](_0x2a88f9);}})[_0x74d9('0x41')](handleError(_0x5773d6,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 14489b6..58b191f 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 _0xcc23=['util','moment','bluebird','rimraf','../../config/environment','exports','define','attachments','lodash'];(function(_0x496ca0,_0x5c8eb1){var _0x109004=function(_0x157eab){while(--_0x157eab){_0x496ca0['push'](_0x496ca0['shift']());}};_0x109004(++_0x5c8eb1);}(_0xcc23,0x167));var _0x3cc2=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xcc23[_0x1780f8];return _0x33a410;};'use strict';var _=require(_0x3cc2('0x0'));var util=require(_0x3cc2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3cc2('0x2'));var BPromise=require(_0x3cc2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3cc2('0x4'));var config=require(_0x3cc2('0x5'));var attributes=require('./attachment.attributes');module[_0x3cc2('0x6')]=function(_0x35653b,_0x21b593){return _0x35653b[_0x3cc2('0x7')]('Attachment',attributes,{'tableName':_0x3cc2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb8a=['api','moment','bluebird','path','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger'];(function(_0x1dc029,_0x17fb0d){var _0x510cb3=function(_0x5a42c0){while(--_0x5a42c0){_0x1dc029['push'](_0x1dc029['shift']());}};_0x510cb3(++_0x17fb0d);}(_0xbb8a,0xae));var _0xabb8=function(_0x2790ed,_0x35544c){_0x2790ed=_0x2790ed-0x0;var _0x1431cc=_0xbb8a[_0x2790ed];return _0x1431cc;};'use strict';var _=require('lodash');var util=require(_0xabb8('0x0'));var logger=require(_0xabb8('0x1'))(_0xabb8('0x2'));var moment=require(_0xabb8('0x3'));var BPromise=require(_0xabb8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabb8('0x5'));var rimraf=require('rimraf');var config=require(_0xabb8('0x6'));var attributes=require(_0xabb8('0x7'));module[_0xabb8('0x8')]=function(_0x2c829e,_0x3d2a5c){return _0x2c829e[_0xabb8('0x9')]('Attachment',attributes,{'tableName':_0xabb8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 2d9c537..b76fbc3 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 _0x3ee5=['body','options','raw','stringify','util','moment','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','error','code','message','result','catch','CreateAttachment','Attachment','create'];(function(_0x179c7b,_0x12bd08){var _0x5b9496=function(_0x37d098){while(--_0x37d098){_0x179c7b['push'](_0x179c7b['shift']());}};_0x5b9496(++_0x12bd08);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x50707b,_0x485f24){_0x50707b=_0x50707b-0x0;var _0x423e5c=_0x3ee5[_0x50707b];return _0x423e5c;};'use strict';var _=require('lodash');var util=require(_0x53ee('0x0'));var moment=require(_0x53ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x53ee('0x2'));var fs=require('fs');var Redis=require(_0x53ee('0x3'));var db=require(_0x53ee('0x4'))['db'];var utils=require(_0x53ee('0x5'));var logger=require(_0x53ee('0x6'))(_0x53ee('0x7'));var config=require(_0x53ee('0x8'));var jayson=require(_0x53ee('0x9'));var client=jayson[_0x53ee('0xa')][_0x53ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3173b2,_0x48bc62,_0x299b23){return new BPromise(function(_0x235c9f,_0x1ec296){return client[_0x53ee('0xc')](_0x3173b2,_0x299b23)[_0x53ee('0xd')](function(_0x3b1252){logger[_0x53ee('0xe')](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));logger[_0x53ee('0x11')](_0x53ee('0x12'),_0x48bc62,_0x53ee('0x10'),JSON['stringify'](_0x3b1252));if(_0x3b1252['error']){if(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x14')]===0x1f4){logger[_0x53ee('0x13')](_0x53ee('0xf'),_0x48bc62,_0x3b1252[_0x53ee('0x13')]['message']);return _0x1ec296(_0x3b1252['error'][_0x53ee('0x15')]);}logger[_0x53ee('0x13')]('Attachment,\x20%s,\x20%s',_0x48bc62,_0x3b1252['error'][_0x53ee('0x15')]);return _0x235c9f(_0x3b1252[_0x53ee('0x13')][_0x53ee('0x15')]);}else{logger['info'](_0x53ee('0xf'),_0x48bc62,_0x53ee('0x10'));_0x235c9f(_0x3b1252[_0x53ee('0x16')][_0x53ee('0x15')]);}})[_0x53ee('0x17')](function(_0x2fb3cd){logger['error'](_0x53ee('0xf'),_0x48bc62,_0x2fb3cd);_0x1ec296(_0x2fb3cd);});});}exports[_0x53ee('0x18')]=function(_0x3d788e){var _0x17c3cb=this;return new Promise(function(_0x708604,_0x29a4b4){return db[_0x53ee('0x19')][_0x53ee('0x1a')](_0x3d788e[_0x53ee('0x1b')],{'raw':_0x3d788e[_0x53ee('0x1c')]?_0x3d788e[_0x53ee('0x1c')][_0x53ee('0x1d')]===undefined?!![]:![]:!![]})[_0x53ee('0xd')](function(_0x2cbd98){logger['info'](_0x53ee('0x18'),_0x3d788e);logger['debug']('CreateAttachment',_0x3d788e,JSON[_0x53ee('0x1e')](_0x2cbd98));_0x708604(_0x2cbd98);})[_0x53ee('0x17')](function(_0x4105d6){logger['error'](_0x53ee('0x18'),_0x4105d6[_0x53ee('0x15')],_0x3d788e);_0x29a4b4(_0x17c3cb[_0x53ee('0x13')](0x1f4,_0x4105d6[_0x53ee('0x15')]));});});};
\ No newline at end of file
+var _0x24cf=['code','message','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error'];(function(_0x2283a9,_0x4e2e63){var _0x3cbc8c=function(_0x282ab5){while(--_0x282ab5){_0x2283a9['push'](_0x2283a9['shift']());}};_0x3cbc8c(++_0x4e2e63);}(_0x24cf,0x1d5));var _0xf24c=function(_0x19f9e9,_0x5ab385){_0x19f9e9=_0x19f9e9-0x0;var _0x2c23cb=_0x24cf[_0x19f9e9];return _0x2c23cb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5104bd,_0x272d25,_0x596e81){return new BPromise(function(_0x3b7cf1,_0x13163e){return client[_0xf24c('0x9')](_0x5104bd,_0x596e81)[_0xf24c('0xa')](function(_0x4b3ea3){logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x272d25,_0xf24c('0xd'),JSON['stringify'](_0x4b3ea3));if(_0x4b3ea3[_0xf24c('0x10')]){if(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x11')]===0x1f4){logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x13163e(_0x4b3ea3['error'][_0xf24c('0x12')]);}logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x3b7cf1(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x12')]);}else{logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));_0x3b7cf1(_0x4b3ea3['result']['message']);}})[_0xf24c('0x13')](function(_0x462801){logger['error'](_0xf24c('0xc'),_0x272d25,_0x462801);_0x13163e(_0x462801);});});}exports[_0xf24c('0x14')]=function(_0x2d9015){var _0x3eb8e1=this;return new Promise(function(_0x1a17c6,_0x3a0b61){return db[_0xf24c('0x15')][_0xf24c('0x16')](_0x2d9015[_0xf24c('0x17')],{'raw':_0x2d9015[_0xf24c('0x18')]?_0x2d9015[_0xf24c('0x18')][_0xf24c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x24bf58){logger[_0xf24c('0xb')]('CreateAttachment',_0x2d9015);logger[_0xf24c('0xe')](_0xf24c('0x14'),_0x2d9015,JSON[_0xf24c('0x1a')](_0x24bf58));_0x1a17c6(_0x24bf58);})['catch'](function(_0x5885a5){logger['error'](_0xf24c('0x14'),_0x5885a5[_0xf24c('0x12')],_0x2d9015);_0x3a0b61(_0x3eb8e1['error'](0x1f4,_0x5885a5[_0xf24c('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index b38080e..e888d8d 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0xc98284,_0xfbb179){_0xc98284=_0xc98284-0x0;var _0x3f9ad2=_0xdb28[_0xc98284];return _0x3f9ad2;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x35f9fe,_0x25746a){_0x35f9fe=_0x35f9fe-0x0;var _0x3327a1=_0xdb28[_0x35f9fe];return _0x3327a1;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 6236748..a5e4e3f 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x395b=['signToken','json','use','User','passport','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','undefined','activedirectory','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','name','password','salt','disabled','online','user','blockedAt','add','clearBlockUser','getLicense','catch','status','role'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x395b,0x79));var _0xb395=function(_0x5d7803,_0x30e9aa){_0x5d7803=_0x5d7803-0x0;var _0x1a43b2=_0x395b[_0x5d7803];return _0x1a43b2;};'use strict';var passport=require(_0xb395('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0xb395('0x1'));var BPromise=require(_0xb395('0x2'));var util=require(_0xb395('0x3'));var db=require(_0xb395('0x4'))['db'];var authService=require(_0xb395('0x5'));var utils=require('../../config/utils');var config=require(_0xb395('0x6'));var logger=require(_0xb395('0x7'))(_0xb395('0x8'));function isActiveDirectoryConfigured(_0x4bb8fa){var _0x24018e=![];if(typeof _0x4bb8fa['activedirectory']!==_0xb395('0x9')){_0x24018e=_0x4bb8fa[_0xb395('0xa')]['baseDN']&&_0x4bb8fa[_0xb395('0xa')]['url']&&_0x4bb8fa['activedirectory'][_0xb395('0xb')];}return _0x24018e;}function adAuthenticate(_0x558d5e,_0x5e36a3,_0x183cb4){return new BPromise(function(_0x3d5282,_0x7bc91e){try{var _0x2e1cda=new ActiveDirectory(_0x558d5e);_0x2e1cda[_0xb395('0xc')](_0x5e36a3,_0x183cb4,function(_0x144e61,_0x1a19d6){if(_0x144e61){logger[_0xb395('0xd')](_0xb395('0xe'),_0x5e36a3,util['inspect'](_0x144e61,{'showHidden':![],'depth':null}));_0x7bc91e(_0xb395('0xf'));}else if(!_0x1a19d6){logger[_0xb395('0xd')](_0xb395('0x10'),_0x5e36a3);_0x7bc91e(_0xb395('0xf'));}else{_0x3d5282(_0x1a19d6);}});}catch(_0x2b2554){_0x7bc91e(_0x2b2554);}});}function ActiveDirectoryAuthenticate(_0x563616,_0x27f0c0,_0x12f760,_0x5e727d){var _0x5201a6,_0x5ee56c;if(!isActiveDirectoryConfigured(config)){logger[_0xb395('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x27f0c0);return _0x5e727d(null,![],{'message':_0xb395('0xf')});}return db[_0xb395('0x11')][_0xb395('0x12')]({'where':{'id':0x1},'attributes':[_0xb395('0x13'),_0xb395('0x14')],'raw':!![]})[_0xb395('0x15')](function(_0x2c0414){_0x5201a6=_0x2c0414;if(!_0x5201a6['adSsoEnabled']){logger[_0xb395('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x27f0c0);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x563616['findOne']({'attributes':['id',_0xb395('0x16'),_0xb395('0x17'),_0xb395('0x18'),'role',_0xb395('0x19'),'blocked','blockedAt',_0xb395('0x1a')],'where':{'name':_0x27f0c0,'role':{'$or':['admin',_0xb395('0x1b'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x37a60c){if(!_0x37a60c||_0x37a60c&&_0x37a60c['name']!==_0x27f0c0){throw new Error(_0xb395('0xf'));}_0x5ee56c=_0x37a60c;var _0x2a1000=_0x5ee56c['name']+'@'+config[_0xb395('0xa')][_0xb395('0xb')];return adAuthenticate(config['activedirectory'],_0x2a1000,_0x12f760);})['then'](function(_0x22c7a3){if(_0x5ee56c[_0xb395('0x19')]){throw new Error(_0xb395('0xf'));}if(_0x5201a6[_0xb395('0x14')]>0x0){if(_0x5ee56c['blocked']){if(moment(_0x5ee56c[_0xb395('0x1c')])[_0xb395('0x1d')](_0x5201a6[_0xb395('0x14')],'minutes')>moment()){throw new Error(_0xb395('0xf'));}return utils[_0xb395('0x1e')](_0x5ee56c,0x0,![],null)[_0xb395('0x15')](function(){return utils['getLicense'](_0x5ee56c);})[_0xb395('0x15')](function(){return _0x5e727d(null,_0x5ee56c);});}else{return utils[_0xb395('0x1f')](_0x5ee56c)[_0xb395('0x15')](function(){return _0x5e727d(null,_0x5ee56c);});}}else{return utils[_0xb395('0x1f')](_0x5ee56c)[_0xb395('0x15')](function(){return _0x5e727d(null,_0x5ee56c);});}})[_0xb395('0x20')](function(_0x214af8){return _0x5e727d(null,![],_0x214af8);});}function handleError(_0x7b29c8,_0x2fba5e,_0x127bb5){return _0x7b29c8[_0xb395('0x21')](_0x2fba5e||0x1f4)['send']({'message':_0x127bb5?_0x127bb5['message']||_0x127bb5:''});}exports['login']=function(_0x47be48,_0x3c7c4b,_0x1ecc90){passport[_0xb395('0xc')]('ad-login',function(_0x2af13c,_0xb19c59,_0x3c51ad){var _0x4ca032=_0x2af13c||_0x3c51ad;if(_0x4ca032){return handleError(_0x3c7c4b,0x191,_0x4ca032);}if(!_0xb19c59){return handleError(_0x3c7c4b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x362bff={'payload':{'id':_0xb19c59['id'],'role':_0xb19c59[_0xb395('0x22')]},'options':{'expiresIn':0x15180}};return authService[_0xb395('0x23')](_0x362bff)[_0xb395('0x15')](function(_0x2d1441){_0x3c7c4b[_0xb395('0x24')]({'id':_0xb19c59['id'],'token':_0x2d1441,'statusCall':'','isAlreadyLogged':_0xb19c59[_0xb395('0x1a')]});});}})(_0x47be48,_0x3c7c4b,_0x1ecc90);};passport[_0xb395('0x25')]('ad-login',new LocalStrategy({'usernameField':_0xb395('0x16'),'passwordField':_0xb395('0x17')},function(_0x1720a1,_0x38b4d6,_0x102059){return ActiveDirectoryAuthenticate(db[_0xb395('0x26')],_0x1720a1,_0x38b4d6,_0x102059);}));
\ No newline at end of file
+var _0xee6f=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blocked','blockedAt','admin','then','name','add','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','User','passport','passport-local','Strategy','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0xee6f,0x1f3));var _0xfee6=function(_0xef4fc0,_0x33cc41){_0xef4fc0=_0xef4fc0-0x0;var _0x57dade=_0xee6f[_0xef4fc0];return _0x57dade;};'use strict';var passport=require(_0xfee6('0x0'));var LocalStrategy=require(_0xfee6('0x1'))[_0xfee6('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xfee6('0x3'));var BPromise=require('bluebird');var util=require(_0xfee6('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xfee6('0x5'));var utils=require(_0xfee6('0x6'));var config=require(_0xfee6('0x7'));var logger=require(_0xfee6('0x8'))('api');function isActiveDirectoryConfigured(_0x382ca9){var _0x31a800=![];if(typeof _0x382ca9[_0xfee6('0x9')]!==_0xfee6('0xa')){_0x31a800=_0x382ca9[_0xfee6('0x9')][_0xfee6('0xb')]&&_0x382ca9[_0xfee6('0x9')][_0xfee6('0xc')]&&_0x382ca9['activedirectory'][_0xfee6('0xd')];}return _0x31a800;}function adAuthenticate(_0x415643,_0x3ad248,_0x58013b){return new BPromise(function(_0x441f2e,_0x39424d){try{var _0x333f5a=new ActiveDirectory(_0x415643);_0x333f5a[_0xfee6('0xe')](_0x3ad248,_0x58013b,function(_0x4412a4,_0x453194){if(_0x4412a4){logger['error'](_0xfee6('0xf'),_0x3ad248,util[_0xfee6('0x10')](_0x4412a4,{'showHidden':![],'depth':null}));_0x39424d(_0xfee6('0x11'));}else if(!_0x453194){logger[_0xfee6('0x12')](_0xfee6('0x13'),_0x3ad248);_0x39424d(_0xfee6('0x11'));}else{_0x441f2e(_0x453194);}});}catch(_0x2ae36d){_0x39424d(_0x2ae36d);}});}function ActiveDirectoryAuthenticate(_0x10ee4d,_0x735e3d,_0x6308ba,_0x206c9d){var _0x514d91,_0xd3cb2a;if(!isActiveDirectoryConfigured(config)){logger[_0xfee6('0x12')](_0xfee6('0x14'),_0x735e3d);return _0x206c9d(null,![],{'message':_0xfee6('0x11')});}return db['Setting'][_0xfee6('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xfee6('0x16')],'raw':!![]})['then'](function(_0x77d050){_0x514d91=_0x77d050;if(!_0x514d91['adSsoEnabled']){logger[_0xfee6('0x12')](_0xfee6('0x17'),_0x735e3d);throw new Error(_0xfee6('0x11'));}return _0x10ee4d[_0xfee6('0x15')]({'attributes':['id','name',_0xfee6('0x18'),_0xfee6('0x19'),_0xfee6('0x1a'),'disabled',_0xfee6('0x1b'),_0xfee6('0x1c'),'online'],'where':{'name':_0x735e3d,'role':{'$or':[_0xfee6('0x1d'),'user','agent']},'adSsoEnabled':!![]}});})[_0xfee6('0x1e')](function(_0x18123d){if(!_0x18123d||_0x18123d&&_0x18123d[_0xfee6('0x1f')]!==_0x735e3d){throw new Error(_0xfee6('0x11'));}_0xd3cb2a=_0x18123d;var _0x32e484=_0xd3cb2a['name']+'@'+config[_0xfee6('0x9')][_0xfee6('0xd')];return adAuthenticate(config['activedirectory'],_0x32e484,_0x6308ba);})[_0xfee6('0x1e')](function(_0x55ffad){if(_0xd3cb2a['disabled']){throw new Error(_0xfee6('0x11'));}if(_0x514d91[_0xfee6('0x16')]>0x0){if(_0xd3cb2a[_0xfee6('0x1b')]){if(moment(_0xd3cb2a[_0xfee6('0x1c')])[_0xfee6('0x20')](_0x514d91['blockDuration'],'minutes')>moment()){throw new Error(_0xfee6('0x11'));}return utils['clearBlockUser'](_0xd3cb2a,0x0,![],null)[_0xfee6('0x1e')](function(){return utils[_0xfee6('0x21')](_0xd3cb2a);})[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}else{return utils['getLicense'](_0xd3cb2a)[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}}else{return utils['getLicense'](_0xd3cb2a)[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}})[_0xfee6('0x22')](function(_0x4bf912){return _0x206c9d(null,![],_0x4bf912);});}function handleError(_0x3951f3,_0x1f0de6,_0x2fdf88){return _0x3951f3['status'](_0x1f0de6||0x1f4)[_0xfee6('0x23')]({'message':_0x2fdf88?_0x2fdf88[_0xfee6('0x24')]||_0x2fdf88:''});}exports[_0xfee6('0x25')]=function(_0x30a32d,_0x1d347e,_0x3b6eb6){passport[_0xfee6('0xe')](_0xfee6('0x26'),function(_0x573376,_0x29d2ab,_0x30d0ac){var _0x5d41a9=_0x573376||_0x30d0ac;if(_0x5d41a9){return handleError(_0x1d347e,0x191,_0x5d41a9);}if(!_0x29d2ab){return handleError(_0x1d347e,0x194,{'message':_0xfee6('0x27')});}else{var _0x1f6e66={'payload':{'id':_0x29d2ab['id'],'role':_0x29d2ab['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1f6e66)[_0xfee6('0x1e')](function(_0x36c40b){_0x1d347e[_0xfee6('0x28')]({'id':_0x29d2ab['id'],'token':_0x36c40b,'statusCall':'','isAlreadyLogged':_0x29d2ab[_0xfee6('0x29')]});});}})(_0x30a32d,_0x1d347e,_0x3b6eb6);};passport['use'](_0xfee6('0x26'),new LocalStrategy({'usernameField':_0xfee6('0x1f'),'passwordField':_0xfee6('0x18')},function(_0x501917,_0x3d2823,_0xaa6320){return ActiveDirectoryAuthenticate(db[_0xfee6('0x2a')],_0x501917,_0x3d2823,_0xaa6320);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index ac844ce..3736e70 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0f2e=['post','exports','express','Router','./authActiveDirectory.controller'];(function(_0x4529df,_0x1b9abd){var _0x41e9d3=function(_0x569224){while(--_0x569224){_0x4529df['push'](_0x4529df['shift']());}};_0x41e9d3(++_0x1b9abd);}(_0x0f2e,0x6b));var _0xe0f2=function(_0x1075b8,_0xd606e2){_0x1075b8=_0x1075b8-0x0;var _0x5d047f=_0x0f2e[_0x1075b8];return _0x5d047f;};'use strict';var express=require(_0xe0f2('0x0'));var router=express[_0xe0f2('0x1')]();var controller=require(_0xe0f2('0x2'));router[_0xe0f2('0x3')]('/',controller['login']);module[_0xe0f2('0x4')]=router;
\ No newline at end of file
+var _0x2e84=['express','Router','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e84,0x150));var _0x42e8=function(_0x436564,_0xeb94af){_0x436564=_0x436564-0x0;var _0x25f606=_0x2e84[_0x436564];return _0x25f606;};'use strict';var express=require(_0x42e8('0x0'));var router=express[_0x42e8('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x42e8('0x2')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index d11bfb0..4abbce7 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x7a54,0x106));var _0x47a5=function(_0x7e7377,_0x3301ec){_0x7e7377=_0x7e7377-0x0;var _0x3978b5=_0x7a54[_0x7e7377];return _0x3978b5;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x504dde,_0x207ebc){var _0x5333c4=function(_0x1136c4){while(--_0x1136c4){_0x504dde['push'](_0x504dde['shift']());}};_0x5333c4(++_0x207ebc);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index ec03671..209b271 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 _0x0060=['setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0060,0xda));var _0x0006=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0x0060[_0x32a81f];return _0x5b67a2;};'use strict';var express=require('express');var passport=require(_0x0006('0x0'));var router=express[_0x0006('0x1')]();var controller=require(_0x0006('0x2'));var userController=require(_0x0006('0x3'));var authService=require('../../components/auth/service');router[_0x0006('0x4')]('/',controller['login']);router[_0x0006('0x4')](_0x0006('0x5'),controller[_0x0006('0x6')],authService['isMiddleware'],userController['login'],authService[_0x0006('0x7')]);module[_0x0006('0x8')]=router;
\ No newline at end of file
+var _0x8b8d=['./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login','setTokenCookie','Router'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8b8d,0x15f));var _0xd8b8=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x8b8d[_0x2576d7];return _0x16a08c;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0xd8b8('0x0')]();var controller=require(_0xd8b8('0x1'));var userController=require(_0xd8b8('0x2'));var authService=require('../../components/auth/service');router[_0xd8b8('0x3')]('/',controller['login']);router[_0xd8b8('0x3')](_0xd8b8('0x4'),controller[_0xd8b8('0x5')],authService['isMiddleware'],userController[_0xd8b8('0x6')],authService[_0xd8b8('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 4d65026..fc90f8c 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 _0x7a73=['Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','save','Password\x20reset!','catch','use','local-login','util','passport','passport-local','Strategy','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','blocked','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','minutes','clearBlockUser','blockedAt','add','getLicense','MailAccount','find','email','Smtp','CloudProvider'];(function(_0x3bd5cd,_0x284a33){var _0x1e9ad2=function(_0xbe0d4e){while(--_0xbe0d4e){_0x3bd5cd['push'](_0x3bd5cd['shift']());}};_0x1e9ad2(++_0x284a33);}(_0x7a73,0xd9));var _0x37a7=function(_0x334b82,_0x56030f){_0x334b82=_0x334b82-0x0;var _0x713ad6=_0x7a73[_0x334b82];return _0x713ad6;};'use strict';var util=require(_0x37a7('0x0'));var passport=require(_0x37a7('0x1'));var LocalStrategy=require(_0x37a7('0x2'))[_0x37a7('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x37a7('0x4'));var moment=require(_0x37a7('0x5'));var db=require(_0x37a7('0x6'))['db'];var authService=require(_0x37a7('0x7'));var utils=require('../../config/utils');var client=jayson[_0x37a7('0x8')][_0x37a7('0x9')]({'port':0x232b});function localAuthenticate(_0x1be633,_0x55fe84,_0x2a1de0,_0x4e445a){var _0x5d0e0c,_0x13c767;return db[_0x37a7('0xa')][_0x37a7('0xb')]({'where':{'id':0x1},'attributes':[_0x37a7('0xc'),_0x37a7('0xd')],'raw':!![]})[_0x37a7('0xe')](function(_0x2cbbbe){_0x5d0e0c=_0x2cbbbe;return _0x1be633[_0x37a7('0xb')]({'attributes':['id',_0x37a7('0xf'),'password',_0x37a7('0x10'),_0x37a7('0x11'),'disabled',_0x37a7('0x12'),'blockedAt','loginAttempts'],'where':{'name':_0x55fe84,'role':{'$or':[_0x37a7('0x13'),_0x37a7('0x14'),_0x37a7('0x15')]}}});})[_0x37a7('0xe')](function(_0x3d38cc){if(!_0x3d38cc||_0x3d38cc&&_0x3d38cc[_0x37a7('0xf')]!==_0x55fe84){throw new Error(_0x37a7('0x16'));}else{_0x13c767=_0x3d38cc;return _0x13c767;}})['then'](function(){_0x13c767[_0x37a7('0x17')](_0x2a1de0,function(_0x5924fc,_0x4419cd){var _0x5ca1e6=_0x13c767['loginAttempts']+0x1;if(_0x5924fc){return _0x4e445a(_0x5924fc);}else if(!_0x4419cd){if(_0x13c767[_0x37a7('0x18')]){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}else if(_0x5d0e0c[_0x37a7('0xc')]>0x0){if(_0x13c767[_0x37a7('0x12')]){if(_0x5d0e0c[_0x37a7('0xd')]>0x0){if(moment(_0x13c767['blockedAt'])['add'](_0x5d0e0c[_0x37a7('0xd')],_0x37a7('0x19'))>moment()){return _0x4e445a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x37a7('0x1a')](_0x13c767,_0x5ca1e6,![],null)[_0x37a7('0xe')](function(){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});});}}else{return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}}else{if(_0x5ca1e6>=_0x5d0e0c[_0x37a7('0xc')]){return utils[_0x37a7('0x1a')](_0x13c767,0x0,!![],moment())[_0x37a7('0xe')](function(){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});});}else{return utils[_0x37a7('0x1a')](_0x13c767,_0x5ca1e6,![],null)[_0x37a7('0xe')](function(){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});});}}}else{return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}}else{if(_0x13c767[_0x37a7('0x18')]){return _0x4e445a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5d0e0c[_0x37a7('0xc')]>0x0){if(_0x13c767['blocked']){if(_0x5d0e0c[_0x37a7('0xd')]>0x0){if(moment(_0x13c767[_0x37a7('0x1b')])[_0x37a7('0x1c')](_0x5d0e0c['blockDuration'],'minutes')>moment()){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}else{return utils[_0x37a7('0x1a')](_0x13c767,0x0,![],null)[_0x37a7('0xe')](function(){return utils[_0x37a7('0x1d')](_0x13c767);})[_0x37a7('0xe')](function(){return _0x4e445a(null,_0x13c767);});}}else{return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}}else{return utils[_0x37a7('0x1a')](_0x13c767,0x0,![],null)[_0x37a7('0xe')](function(){return utils[_0x37a7('0x1d')](_0x13c767);})[_0x37a7('0xe')](function(){return _0x4e445a(null,_0x13c767);})['catch'](function(_0x43a310){return _0x4e445a(null,![],_0x43a310);});}}else{if(_0x13c767[_0x37a7('0x12')]){return _0x4e445a(null,![],{'message':_0x37a7('0x16')});}else{return utils['getLicense'](_0x13c767)[_0x37a7('0xe')](function(){return _0x4e445a(null,_0x13c767);});}}}});})['catch'](function(_0x106aa6){return _0x4e445a(null,![],_0x106aa6);});}function sendServiceMail(_0x5cf880){return db[_0x37a7('0x1e')][_0x37a7('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x37a7('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x37a7('0x21'),'include':[{'model':db[_0x37a7('0x22')],'as':_0x37a7('0x22')}]}]})['then'](function(_0x14f66c){if(!_0x14f66c){throw new Error(_0x37a7('0x23'));}var _0x43d273=_0x14f66c[_0x37a7('0x24')]();var _0x89f81={'account':_0x43d273,'message':_['merge']({'from':util[_0x37a7('0x25')](_0x37a7('0x26'),_0x14f66c[_0x37a7('0xf')],_0x14f66c['email']||_0x14f66c[_0x37a7('0x21')][_0x37a7('0x14')])},_0x5cf880)};return client[_0x37a7('0x27')](_0x37a7('0x28'),_0x89f81);})[_0x37a7('0xe')](function(_0x2b54e1){if(_0x2b54e1[_0x37a7('0x29')]){throw new Error(util[_0x37a7('0x25')](_0x37a7('0x2a'),_0x2b54e1[_0x37a7('0x29')][_0x37a7('0x2b')]||JSON[_0x37a7('0x2c')](_0x2b54e1[_0x37a7('0x29')])));}return!![];});}function handleError(_0x261fa3,_0x5eede9,_0x214cda){return _0x261fa3[_0x37a7('0x2d')](_0x5eede9||0x1f4)[_0x37a7('0x2e')]({'message':_0x214cda?_0x214cda[_0x37a7('0x2b')]||_0x214cda:''});}exports[_0x37a7('0x2f')]=function(_0x3eed76,_0x47ce23,_0x16e678){passport[_0x37a7('0x17')]('local-login',function(_0x365d8f,_0x538113,_0x25d820){var _0x12e72e=_0x365d8f||_0x25d820;if(_0x12e72e){return handleError(_0x47ce23,0x191,_0x12e72e);}if(!_0x538113){return handleError(_0x47ce23,0x194,{'message':_0x37a7('0x30')});}else{var _0x2153c8={'payload':{'id':_0x538113['id'],'role':_0x538113['role']},'options':{'expiresIn':0x15180}};return authService[_0x37a7('0x31')](_0x2153c8)[_0x37a7('0xe')](function(_0x564ee5){_0x47ce23[_0x37a7('0x32')]({'id':_0x538113['id'],'token':_0x564ee5,'statusCall':'','isAlreadyLogged':_0x538113[_0x37a7('0x33')]});});}})(_0x3eed76,_0x47ce23,_0x16e678);};exports['forgot']=function(_0x479157,_0x45cc55){if(!_0x479157[_0x37a7('0x34')][_0x37a7('0x20')]){return handleError(_0x45cc55,0x1f4,{'message':_0x37a7('0x35')});}var _0x2811fe=rs[_0x37a7('0x36')]();_0x479157['body'][_0x37a7('0x20')]=_0x479157[_0x37a7('0x34')][_0x37a7('0x20')][_0x37a7('0x37')]()[_0x37a7('0x38')]();var _0x5919df;return db['Setting'][_0x37a7('0xb')]({'where':{'id':0x1},'attributes':[_0x37a7('0xc'),_0x37a7('0xd')],'raw':!![]})[_0x37a7('0xe')](function(_0x2edaa5){_0x5919df=_0x2edaa5;return db['User'][_0x37a7('0x1f')]({'where':{'email':_0x479157[_0x37a7('0x34')][_0x37a7('0x20')]}});})[_0x37a7('0xe')](function(_0x503a53){if(!_0x503a53){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x503a53['disabled']){throw new Error(_0x37a7('0x39'));}if(_0x503a53['blocked']){if(moment(_0x503a53['blockedAt'])[_0x37a7('0x1c')](_0x5919df[_0x37a7('0xd')],'minutes')>moment()){throw new Error(_0x37a7('0x3a'));}else{_0x503a53[_0x37a7('0x12')]=![];_0x503a53[_0x37a7('0x1b')]=null;}}_0x503a53['resetPasswordToken']=_0x2811fe;_0x503a53[_0x37a7('0x3b')]=Date[_0x37a7('0x3c')]()+0x36ee80;return _0x503a53['save']();})[_0x37a7('0xe')](function(){return sendServiceMail({'to':_0x479157['body'][_0x37a7('0x20')],'subject':_0x37a7('0x3d'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x37a7('0x3e')+'https://'+_0x479157[_0x37a7('0x3f')][_0x37a7('0x40')]+_0x37a7('0x41')+_0x2811fe+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x37a7('0xe')](function(){_0x45cc55[_0x37a7('0x2d')](0xc8)[_0x37a7('0x2e')]({'message':_0x37a7('0x42')});})['catch'](function(_0x132464){return handleError(_0x45cc55,0x1f4,_0x132464);});};exports[_0x37a7('0x43')]=function(_0x8d61e0,_0x588c27){return db[_0x37a7('0x44')][_0x37a7('0x1f')]({'where':{'resetPasswordToken':_0x8d61e0[_0x37a7('0x45')][_0x37a7('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x37a7('0xe')](function(_0x5eb4cc){if(!_0x5eb4cc){throw new Error(_0x37a7('0x47'));}return db[_0x37a7('0xa')][_0x37a7('0xb')]({'attributes':['id',_0x37a7('0x48'),_0x37a7('0x49'),_0x37a7('0x4a')]})[_0x37a7('0xe')](function(_0x4e5518){if(_0x4e5518['securePassword'])authService[_0x37a7('0x4b')](_0x8d61e0[_0x37a7('0x34')][_0x37a7('0x4c')]);if(!_0x4e5518[_0x37a7('0x49')]||!_0x5eb4cc[_0x37a7('0x4d')])return _0x5eb4cc;authService['validatePasswordHistory'](_0x8d61e0[_0x37a7('0x34')]['password'],_0x5eb4cc[_0x37a7('0x4d')],_0x4e5518[_0x37a7('0x4a')]);return _0x5eb4cc;})['then'](function(){_0x5eb4cc[_0x37a7('0x4c')]=_0x8d61e0[_0x37a7('0x34')][_0x37a7('0x4c')];_0x5eb4cc[_0x37a7('0x4e')]=null;_0x5eb4cc[_0x37a7('0x3b')]=null;return _0x5eb4cc[_0x37a7('0x4f')]();});})[_0x37a7('0xe')](function(){_0x588c27['status'](0xc8)['send']({'message':_0x37a7('0x50')});})[_0x37a7('0x51')](function(_0x37034f){return handleError(_0x588c27,0x1f4,_0x37034f);});};passport[_0x37a7('0x52')](_0x37a7('0x53'),new LocalStrategy({'usernameField':_0x37a7('0xf'),'passwordField':_0x37a7('0x4c')},function(_0x1b0ffa,_0x21bd51,_0x1e1366){return localAuthenticate(db[_0x37a7('0x44')],_0x1b0ffa,_0x21bd51,_0x1e1366);}));
\ No newline at end of file
+var _0xe34f=['securePassword','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','catch','use','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','blockedAt','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','minutes','clearBlockUser','add','getLicense','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','authenticate','local-login','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','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','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit'];(function(_0x762129,_0x2014e2){var _0x327472=function(_0x15e8dd){while(--_0x15e8dd){_0x762129['push'](_0x762129['shift']());}};_0x327472(++_0x2014e2);}(_0xe34f,0x19e));var _0xfe34=function(_0x1d353d,_0x71f4f0){_0x1d353d=_0x1d353d-0x0;var _0x1d8714=_0xe34f[_0x1d353d];return _0x1d8714;};'use strict';var util=require('util');var passport=require(_0xfe34('0x0'));var LocalStrategy=require(_0xfe34('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xfe34('0x2'));var rs=require('randomstring');var moment=require(_0xfe34('0x3'));var db=require(_0xfe34('0x4'))['db'];var authService=require(_0xfe34('0x5'));var utils=require(_0xfe34('0x6'));var client=jayson[_0xfe34('0x7')][_0xfe34('0x8')]({'port':0x232b});function localAuthenticate(_0x288dac,_0x20917f,_0x9e2042,_0x58dee7){var _0x3a6a41,_0x8dcd63;return db[_0xfe34('0x9')][_0xfe34('0xa')]({'where':{'id':0x1},'attributes':[_0xfe34('0xb'),_0xfe34('0xc')],'raw':!![]})['then'](function(_0x25a03a){_0x3a6a41=_0x25a03a;return _0x288dac['findOne']({'attributes':['id',_0xfe34('0xd'),'password',_0xfe34('0xe'),_0xfe34('0xf'),_0xfe34('0x10'),_0xfe34('0x11'),_0xfe34('0x12'),'loginAttempts'],'where':{'name':_0x20917f,'role':{'$or':[_0xfe34('0x13'),_0xfe34('0x14'),_0xfe34('0x15')]}}});})[_0xfe34('0x16')](function(_0x4c2a27){if(!_0x4c2a27||_0x4c2a27&&_0x4c2a27[_0xfe34('0xd')]!==_0x20917f){throw new Error(_0xfe34('0x17'));}else{_0x8dcd63=_0x4c2a27;return _0x8dcd63;}})[_0xfe34('0x16')](function(){_0x8dcd63['authenticate'](_0x9e2042,function(_0x40a3a1,_0x4aa71e){var _0x19f9cc=_0x8dcd63[_0xfe34('0x18')]+0x1;if(_0x40a3a1){return _0x58dee7(_0x40a3a1);}else if(!_0x4aa71e){if(_0x8dcd63[_0xfe34('0x10')]){return _0x58dee7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3a6a41[_0xfe34('0xb')]>0x0){if(_0x8dcd63[_0xfe34('0x11')]){if(_0x3a6a41[_0xfe34('0xc')]>0x0){if(moment(_0x8dcd63[_0xfe34('0x12')])['add'](_0x3a6a41['blockDuration'],_0xfe34('0x19'))>moment()){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1a')](_0x8dcd63,_0x19f9cc,![],null)['then'](function(){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});});}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{if(_0x19f9cc>=_0x3a6a41[_0xfe34('0xb')]){return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,!![],moment())[_0xfe34('0x16')](function(){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});});}else{return utils['clearBlockUser'](_0x8dcd63,_0x19f9cc,![],null)[_0xfe34('0x16')](function(){return _0x58dee7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{if(_0x8dcd63[_0xfe34('0x10')]){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else if(_0x3a6a41['allowedLoginAttempts']>0x0){if(_0x8dcd63['blocked']){if(_0x3a6a41[_0xfe34('0xc')]>0x0){if(moment(_0x8dcd63[_0xfe34('0x12')])[_0xfe34('0x1b')](_0x3a6a41[_0xfe34('0xc')],_0xfe34('0x19'))>moment()){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,![],null)['then'](function(){return utils[_0xfe34('0x1c')](_0x8dcd63);})[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);});}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,![],null)[_0xfe34('0x16')](function(){return utils[_0xfe34('0x1c')](_0x8dcd63);})[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);})['catch'](function(_0x5313e8){return _0x58dee7(null,![],_0x5313e8);});}}else{if(_0x8dcd63['blocked']){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1c')](_0x8dcd63)[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);});}}}});})['catch'](function(_0x30e6bd){return _0x58dee7(null,![],_0x30e6bd);});}function sendServiceMail(_0x4f111e){return db['MailAccount'][_0xfe34('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xfe34('0xd'),_0xfe34('0x1e')],'include':[{'model':db[_0xfe34('0x1f')],'as':'Smtp','include':[{'model':db[_0xfe34('0x20')],'as':'CloudProvider'}]}]})['then'](function(_0x3da0ad){if(!_0x3da0ad){throw new Error(_0xfe34('0x21'));}var _0x224893=_0x3da0ad['getSmtpOptions']();var _0x304852={'account':_0x224893,'message':_['merge']({'from':util[_0xfe34('0x22')](_0xfe34('0x23'),_0x3da0ad[_0xfe34('0xd')],_0x3da0ad['email']||_0x3da0ad[_0xfe34('0x24')]['user'])},_0x4f111e)};return client[_0xfe34('0x25')](_0xfe34('0x26'),_0x304852);})['then'](function(_0x56c260){if(_0x56c260[_0xfe34('0x27')]){throw new Error(util[_0xfe34('0x22')](_0xfe34('0x28'),_0x56c260[_0xfe34('0x27')]['message']||JSON[_0xfe34('0x29')](_0x56c260[_0xfe34('0x27')])));}return!![];});}function handleError(_0x3473ae,_0x118c94,_0x4b9430){return _0x3473ae[_0xfe34('0x2a')](_0x118c94||0x1f4)[_0xfe34('0x2b')]({'message':_0x4b9430?_0x4b9430[_0xfe34('0x2c')]||_0x4b9430:''});}exports[_0xfe34('0x2d')]=function(_0x382efb,_0x2df6e4,_0x5f1ab5){passport[_0xfe34('0x2e')](_0xfe34('0x2f'),function(_0x30336a,_0x4df23c,_0x379c18){var _0x32ce0d=_0x30336a||_0x379c18;if(_0x32ce0d){return handleError(_0x2df6e4,0x191,_0x32ce0d);}if(!_0x4df23c){return handleError(_0x2df6e4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x152df1={'payload':{'id':_0x4df23c['id'],'role':_0x4df23c[_0xfe34('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xfe34('0x30')](_0x152df1)[_0xfe34('0x16')](function(_0x48466b){_0x2df6e4[_0xfe34('0x31')]({'id':_0x4df23c['id'],'token':_0x48466b,'statusCall':'','isAlreadyLogged':_0x4df23c[_0xfe34('0x32')]});});}})(_0x382efb,_0x2df6e4,_0x5f1ab5);};exports['forgot']=function(_0x3f845d,_0xc1ddba){if(!_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')]){return handleError(_0xc1ddba,0x1f4,{'message':_0xfe34('0x34')});}var _0x5ad626=rs[_0xfe34('0x35')]();_0x3f845d['body']['email']=_0x3f845d['body'][_0xfe34('0x1e')]['trim']()['toLowerCase']();var _0xf204d6;return db[_0xfe34('0x9')][_0xfe34('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xfe34('0xc')],'raw':!![]})['then'](function(_0x39249b){_0xf204d6=_0x39249b;return db['User'][_0xfe34('0x1d')]({'where':{'email':_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')]}});})[_0xfe34('0x16')](function(_0x5949e2){if(!_0x5949e2){throw new Error(_0xfe34('0x36'));}if(_0x5949e2['disabled']){throw new Error(_0xfe34('0x37'));}if(_0x5949e2[_0xfe34('0x11')]){if(moment(_0x5949e2['blockedAt'])['add'](_0xf204d6[_0xfe34('0xc')],_0xfe34('0x19'))>moment()){throw new Error(_0xfe34('0x38'));}else{_0x5949e2[_0xfe34('0x11')]=![];_0x5949e2[_0xfe34('0x12')]=null;}}_0x5949e2['resetPasswordToken']=_0x5ad626;_0x5949e2[_0xfe34('0x39')]=Date['now']()+0x36ee80;return _0x5949e2[_0xfe34('0x3a')]();})['then'](function(){return sendServiceMail({'to':_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')],'subject':_0xfe34('0x3b'),'text':_0xfe34('0x3c')+_0xfe34('0x3d')+'https://'+_0x3f845d[_0xfe34('0x3e')][_0xfe34('0x3f')]+_0xfe34('0x40')+_0x5ad626+'\x0a\x0a'+_0xfe34('0x41')});})['then'](function(){_0xc1ddba[_0xfe34('0x2a')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x4efd75){return handleError(_0xc1ddba,0x1f4,_0x4efd75);});};exports['reset']=function(_0x59278a,_0x5a4c6d){return db[_0xfe34('0x42')][_0xfe34('0x1d')]({'where':{'resetPasswordToken':_0x59278a[_0xfe34('0x43')][_0xfe34('0x44')],'resetPasswordExpires':{'$gt':Date[_0xfe34('0x45')]()}}})[_0xfe34('0x16')](function(_0x92a4aa){if(!_0x92a4aa){throw new Error(_0xfe34('0x46'));}return db[_0xfe34('0x9')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0xfe34('0x47')]})[_0xfe34('0x16')](function(_0x341570){if(_0x341570[_0xfe34('0x48')])authService[_0xfe34('0x49')](_0x59278a[_0xfe34('0x33')][_0xfe34('0x4a')]);if(!_0x341570['enforcePasswordHistory']||!_0x92a4aa['previousPasswords'])return _0x92a4aa;authService[_0xfe34('0x4b')](_0x59278a[_0xfe34('0x33')]['password'],_0x92a4aa[_0xfe34('0x4c')],_0x341570['passwordHistoryLimit']);return _0x92a4aa;})['then'](function(){_0x92a4aa[_0xfe34('0x4a')]=_0x59278a['body'][_0xfe34('0x4a')];_0x92a4aa[_0xfe34('0x4d')]=null;_0x92a4aa['resetPasswordExpires']=null;return _0x92a4aa[_0xfe34('0x3a')]();});})['then'](function(){_0x5a4c6d[_0xfe34('0x2a')](0xc8)['send']({'message':_0xfe34('0x4e')});})[_0xfe34('0x4f')](function(_0x30d7ce){return handleError(_0x5a4c6d,0x1f4,_0x30d7ce);});};passport[_0xfe34('0x50')](_0xfe34('0x2f'),new LocalStrategy({'usernameField':_0xfe34('0xd'),'passwordField':_0xfe34('0x4a')},function(_0x3631bc,_0x3c3d09,_0x2c2a33){return localAuthenticate(db[_0xfe34('0x42')],_0x3631bc,_0x3c3d09,_0x2c2a33);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index f41082e..1ea2441 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 _0xc784=['forgot','reset','exports','express','./authLocal.controller','post','login','/forgot'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0xc784,0xb3));var _0x4c78=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0xc784[_0x46cf00];return _0x3974dc;};'use strict';var express=require(_0x4c78('0x0'));var router=express['Router']();var controller=require(_0x4c78('0x1'));router[_0x4c78('0x2')]('/',controller[_0x4c78('0x3')]);router['post'](_0x4c78('0x4'),controller[_0x4c78('0x5')]);router['post']('/reset/:token',controller[_0x4c78('0x6')]);module[_0x4c78('0x7')]=router;
\ No newline at end of file
+var _0xbf5a=['login','post','/forgot','forgot','reset','exports','express','Router','./authLocal.controller'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0xbf5a,0x177));var _0xabf5=function(_0x242a25,_0x5e89fa){_0x242a25=_0x242a25-0x0;var _0x63ce6c=_0xbf5a[_0x242a25];return _0x63ce6c;};'use strict';var express=require(_0xabf5('0x0'));var router=express[_0xabf5('0x1')]();var controller=require(_0xabf5('0x2'));router['post']('/',controller[_0xabf5('0x3')]);router[_0xabf5('0x4')](_0xabf5('0x5'),controller[_0xabf5('0x6')]);router[_0xabf5('0x4')]('/reset/:token',controller[_0xabf5('0x7')]);module[_0xabf5('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index adf19af..ed0494f 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 _0x90b2=['STRING','INTEGER','sequelize','exports'];(function(_0x5a852b,_0x1694c2){var _0xd74d84=function(_0x170a6d){while(--_0x170a6d){_0x5a852b['push'](_0x5a852b['shift']());}};_0xd74d84(++_0x1694c2);}(_0x90b2,0x1b2));var _0x290b=function(_0x1a212a,_0x64496b){_0x1a212a=_0x1a212a-0x0;var _0x22d075=_0x90b2[_0x1a212a];return _0x22d075;};'use strict';var Sequelize=require(_0x290b('0x0'));module[_0x290b('0x1')]={'name':{'type':Sequelize[_0x290b('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x290b('0x2')]},'description':{'type':Sequelize[_0x290b('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x290b('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x34d2=['exports','STRING','BOOLEAN','sequelize'];(function(_0x511f3c,_0x5a4c42){var _0x466c5a=function(_0x1821bd){while(--_0x1821bd){_0x511f3c['push'](_0x511f3c['shift']());}};_0x466c5a(++_0x5a4c42);}(_0x34d2,0x143));var _0x234d=function(_0x264733,_0x13200e){_0x264733=_0x264733-0x0;var _0x433704=_0x34d2[_0x264733];return _0x433704;};'use strict';var Sequelize=require(_0x234d('0x0'));module[_0x234d('0x1')]={'name':{'type':Sequelize[_0x234d('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x234d('0x2')]},'status':{'type':Sequelize[_0x234d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 df0160d..cd3e572 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 _0x68f2=['order','hasOwnProperty','addActions','omit','Action','getActions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','getConditions','findOne'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x68f2,0x1b4));var _0x268f=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x68f2[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x268f('0x0'));var zipdir=require(_0x268f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x268f('0x2'));var moment=require(_0x268f('0x3'));var BPromise=require(_0x268f('0x4'));var Mustache=require(_0x268f('0x5'));var util=require(_0x268f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x268f('0x7'));var ejs=require(_0x268f('0x8'));var fs=require('fs');var fs_extra=require(_0x268f('0x9'));var _=require(_0x268f('0xa'));var squel=require(_0x268f('0xb'));var crypto=require(_0x268f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x268f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x268f('0xe'));var Papa=require(_0x268f('0xf'));var Redis=require(_0x268f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x268f('0x11'));var as=require(_0x268f('0x12'));var hardwareService=require(_0x268f('0x13'));var logger=require(_0x268f('0x14'))(_0x268f('0x15'));var utils=require(_0x268f('0x16'));var config=require(_0x268f('0x17'));var licenseUtil=require(_0x268f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eaa,_0xec56b0){_0xec56b0=_0xec56b0||0xcc;return function(_0x302719){if(_0x302719){return _0x3eaa[_0x268f('0x19')](_0xec56b0);}return _0x3eaa[_0x268f('0x1a')](_0xec56b0)[_0x268f('0x1b')]();};}function respondWithResult(_0x13ceaa,_0x53e6fc){_0x53e6fc=_0x53e6fc||0xc8;return function(_0x59b19d){if(_0x59b19d){return _0x13ceaa[_0x268f('0x1a')](_0x53e6fc)['json'](_0x59b19d);}};}function respondWithFilteredResult(_0x4b0d02,_0x315d7d){return function(_0xd01f57){if(_0xd01f57){var _0x37a3a9=typeof _0x315d7d['offset']===_0x268f('0x1c')&&typeof _0x315d7d[_0x268f('0x1d')]===_0x268f('0x1c');var _0x59bb8e=_0xd01f57[_0x268f('0x1e')];var _0x1897b7=_0x37a3a9?0x0:_0x315d7d[_0x268f('0x1f')];var _0x79eae5=_0x37a3a9?_0xd01f57[_0x268f('0x1e')]:_0x315d7d[_0x268f('0x1f')]+_0x315d7d[_0x268f('0x1d')];var _0x41d2ff;if(_0x79eae5>=_0x59bb8e){_0x79eae5=_0x59bb8e;_0x41d2ff=0xc8;}else{_0x41d2ff=0xce;}_0x4b0d02['status'](_0x41d2ff);return _0x4b0d02[_0x268f('0x20')](_0x268f('0x21'),_0x1897b7+'-'+_0x79eae5+'/'+_0x59bb8e)['json'](_0xd01f57);}return null;};}function patchUpdates(_0x359044){return function(_0x4ecd27){try{jsonpatch[_0x268f('0x22')](_0x4ecd27,_0x359044,!![]);}catch(_0xd03ebe){return BPromise[_0x268f('0x23')](_0xd03ebe);}return _0x4ecd27[_0x268f('0x24')]();};}function saveUpdates(_0x4c3e59,_0x167ff4){return function(_0x1e472d){if(_0x1e472d){return _0x1e472d[_0x268f('0x25')](_0x4c3e59)[_0x268f('0x26')](function(_0x385093){return _0x385093;});}return null;};}function removeEntity(_0x4793a3,_0x3ea423){return function(_0x16fa7d){if(_0x16fa7d){return _0x16fa7d[_0x268f('0x27')]()[_0x268f('0x26')](function(){_0x4793a3[_0x268f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b51d9,_0x57d1f1){return function(_0x3875f6){if(!_0x3875f6){_0x3b51d9[_0x268f('0x19')](0x194);}return _0x3875f6;};}function handleError(_0x3cb9f1,_0xb08117){_0xb08117=_0xb08117||0x1f4;return function(_0x178d7e){logger['error'](_0x178d7e[_0x268f('0x28')]);if(_0x178d7e[_0x268f('0x29')]){delete _0x178d7e['name'];}_0x3cb9f1[_0x268f('0x1a')](_0xb08117)['send'](_0x178d7e);};}exports[_0x268f('0x2a')]=function(_0x4b3808,_0x5b6438){var _0xf455da={},_0x2e0b1e={},_0x59b081={'count':0x0,'rows':[]};var _0x3fd7cf=_[_0x268f('0x2b')](db[_0x268f('0x2c')][_0x268f('0x2d')],function(_0x4450ee){return{'name':_0x4450ee[_0x268f('0x2e')],'type':_0x4450ee[_0x268f('0x2f')][_0x268f('0x30')]};});_0x2e0b1e['model']=_['map'](_0x3fd7cf,'name');_0x2e0b1e[_0x268f('0x31')]=_[_0x268f('0x32')](_0x4b3808[_0x268f('0x31')]);_0x2e0b1e['filters']=_[_0x268f('0x33')](_0x2e0b1e['model'],_0x2e0b1e['query']);_0xf455da[_0x268f('0x34')]=_[_0x268f('0x33')](_0x2e0b1e[_0x268f('0x35')],qs[_0x268f('0x36')](_0x4b3808['query']['fields']));_0xf455da[_0x268f('0x34')]=_0xf455da[_0x268f('0x34')][_0x268f('0x37')]?_0xf455da[_0x268f('0x34')]:_0x2e0b1e[_0x268f('0x35')];if(!_0x4b3808[_0x268f('0x31')]['hasOwnProperty'](_0x268f('0x38'))){_0xf455da['limit']=qs[_0x268f('0x1d')](_0x4b3808[_0x268f('0x31')][_0x268f('0x1d')]);_0xf455da['offset']=qs['offset'](_0x4b3808[_0x268f('0x31')][_0x268f('0x1f')]);}_0xf455da['order']=qs[_0x268f('0x39')](_0x4b3808[_0x268f('0x31')][_0x268f('0x39')]);_0xf455da[_0x268f('0x3a')]=qs[_0x268f('0x3b')](_[_0x268f('0x3c')](_0x4b3808['query'],_0x2e0b1e['filters']),_0x3fd7cf);if(_0x4b3808['query'][_0x268f('0x3d')]){_0xf455da[_0x268f('0x3a')]=_[_0x268f('0x3e')](_0xf455da[_0x268f('0x3a')],{'$or':_[_0x268f('0x2b')](_0x3fd7cf,function(_0x4d9f8e){if(_0x4d9f8e[_0x268f('0x2f')]!==_0x268f('0x3f')){var _0x33f293={};_0x33f293[_0x4d9f8e[_0x268f('0x29')]]={'$like':'%'+_0x4b3808[_0x268f('0x31')][_0x268f('0x3d')]+'%'};return _0x33f293;}})});}_0xf455da=_[_0x268f('0x3e')]({},_0xf455da,_0x4b3808[_0x268f('0x40')]);var _0x4178e1={'where':_0xf455da['where']};return db['Automation']['count'](_0x4178e1)[_0x268f('0x26')](function(_0x3e0b17){_0x59b081[_0x268f('0x1e')]=_0x3e0b17;if(_0x4b3808[_0x268f('0x31')][_0x268f('0x41')]){_0xf455da[_0x268f('0x42')]=[{'all':!![]}];}return db[_0x268f('0x2c')][_0x268f('0x43')](_0xf455da);})[_0x268f('0x26')](function(_0x5b4c17){_0x59b081[_0x268f('0x44')]=_0x5b4c17;return _0x59b081;})[_0x268f('0x26')](respondWithFilteredResult(_0x5b6438,_0xf455da))[_0x268f('0x45')](handleError(_0x5b6438,null));};exports[_0x268f('0x46')]=function(_0x1ac90f,_0x710c72){var _0x7eb11f={'raw':![],'where':{'id':_0x1ac90f[_0x268f('0x47')]['id']}},_0x1728b5={};_0x1728b5[_0x268f('0x35')]=_['keys'](db[_0x268f('0x2c')][_0x268f('0x2d')]);_0x1728b5['query']=_['keys'](_0x1ac90f[_0x268f('0x31')]);_0x1728b5['filters']=_[_0x268f('0x33')](_0x1728b5[_0x268f('0x35')],_0x1728b5['query']);_0x7eb11f['attributes']=_[_0x268f('0x33')](_0x1728b5['model'],qs['fields'](_0x1ac90f['query'][_0x268f('0x36')]));_0x7eb11f['attributes']=_0x7eb11f[_0x268f('0x34')]['length']?_0x7eb11f[_0x268f('0x34')]:_0x1728b5[_0x268f('0x35')];if(_0x1ac90f[_0x268f('0x31')]['includeAll']){_0x7eb11f[_0x268f('0x42')]=[{'all':!![]}];}_0x7eb11f=_[_0x268f('0x3e')]({},_0x7eb11f,_0x1ac90f['options']);return db[_0x268f('0x2c')][_0x268f('0x48')](_0x7eb11f)[_0x268f('0x26')](handleEntityNotFound(_0x710c72,null))[_0x268f('0x26')](respondWithResult(_0x710c72,null))[_0x268f('0x45')](handleError(_0x710c72,null));};exports[_0x268f('0x49')]=function(_0x7cdf6b,_0x181dfb){return db[_0x268f('0x2c')][_0x268f('0x49')](_0x7cdf6b[_0x268f('0x4a')],{})[_0x268f('0x26')](respondWithResult(_0x181dfb,0xc9))['catch'](handleError(_0x181dfb,null));};exports[_0x268f('0x25')]=function(_0x3225b4,_0x4f8783){if(_0x3225b4[_0x268f('0x4a')]['id']){delete _0x3225b4[_0x268f('0x4a')]['id'];}return db[_0x268f('0x2c')][_0x268f('0x48')]({'where':{'id':_0x3225b4[_0x268f('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f8783,null))['then'](saveUpdates(_0x3225b4[_0x268f('0x4a')],null))[_0x268f('0x26')](respondWithResult(_0x4f8783,null))[_0x268f('0x45')](handleError(_0x4f8783,null));};exports[_0x268f('0x27')]=function(_0x4c7033,_0x53d857){return db['Automation'][_0x268f('0x48')]({'where':{'id':_0x4c7033[_0x268f('0x47')]['id']}})[_0x268f('0x26')](handleEntityNotFound(_0x53d857,null))[_0x268f('0x26')](removeEntity(_0x53d857,null))[_0x268f('0x45')](handleError(_0x53d857,null));};exports[_0x268f('0x4b')]=function(_0x1a0494,_0x1fe275,_0x2b6c20){return db[_0x268f('0x4c')][_0x268f('0x48')]({'where':{'id':_0x1a0494[_0x268f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fe275,null))['then'](function(_0x297849){if(_0x297849){return _0x297849[_0x268f('0x4b')](_0x1a0494[_0x268f('0x4a')][_0x268f('0x4d')],_['omit'](_0x1a0494[_0x268f('0x4a')],[_0x268f('0x4d'),'id'])||{});}})[_0x268f('0x26')](respondWithResult(_0x1fe275,null))[_0x268f('0x45')](handleError(_0x1fe275,null));};exports[_0x268f('0x4e')]=function(_0x1e0d85,_0x508727,_0x471986){var _0x518635={};var _0x30556a={};var _0x51fd49;var _0x44a8d7;return db['Automation'][_0x268f('0x4f')]({'where':{'id':_0x1e0d85[_0x268f('0x47')]['id']}})[_0x268f('0x26')](handleEntityNotFound(_0x508727,null))[_0x268f('0x26')](function(_0x565e88){if(_0x565e88){_0x51fd49=_0x565e88;_0x30556a[_0x268f('0x35')]=_[_0x268f('0x32')](db['Condition'][_0x268f('0x2d')]);_0x30556a[_0x268f('0x31')]=_[_0x268f('0x32')](_0x1e0d85['query']);_0x30556a[_0x268f('0x3b')]=_[_0x268f('0x33')](_0x30556a['model'],_0x30556a[_0x268f('0x31')]);_0x518635[_0x268f('0x34')]=_[_0x268f('0x33')](_0x30556a[_0x268f('0x35')],qs[_0x268f('0x36')](_0x1e0d85[_0x268f('0x31')][_0x268f('0x36')]));_0x518635[_0x268f('0x34')]=_0x518635[_0x268f('0x34')][_0x268f('0x37')]?_0x518635[_0x268f('0x34')]:_0x30556a[_0x268f('0x35')];_0x518635[_0x268f('0x50')]=qs[_0x268f('0x39')](_0x1e0d85['query'][_0x268f('0x39')]);_0x518635['where']=qs[_0x268f('0x3b')](_[_0x268f('0x3c')](_0x1e0d85['query'],_0x30556a[_0x268f('0x3b')]));if(_0x1e0d85[_0x268f('0x31')][_0x268f('0x3d')]){_0x518635[_0x268f('0x3a')]=_['merge'](_0x518635['where'],{'$or':_['map'](_0x518635[_0x268f('0x34')],function(_0x17d146){var _0x3179c7={};_0x3179c7[_0x17d146]={'$like':'%'+_0x1e0d85[_0x268f('0x31')][_0x268f('0x3d')]+'%'};return _0x3179c7;})});}_0x518635=_['merge']({},_0x518635,_0x1e0d85[_0x268f('0x40')]);return _0x51fd49['getConditions'](_0x518635);}})[_0x268f('0x26')](function(_0x5c22ad){if(_0x5c22ad){_0x44a8d7=_0x5c22ad['length'];if(!_0x1e0d85['query'][_0x268f('0x51')](_0x268f('0x38'))){_0x518635[_0x268f('0x1d')]=qs[_0x268f('0x1d')](_0x1e0d85[_0x268f('0x31')][_0x268f('0x1d')]);_0x518635[_0x268f('0x1f')]=qs[_0x268f('0x1f')](_0x1e0d85['query']['offset']);}return _0x51fd49[_0x268f('0x4e')](_0x518635);}})['then'](function(_0x1ed14c){if(_0x1ed14c){return _0x1ed14c?{'count':_0x44a8d7,'rows':_0x1ed14c}:null;}})[_0x268f('0x26')](respondWithResult(_0x508727,null))[_0x268f('0x45')](handleError(_0x508727,null));};exports[_0x268f('0x52')]=function(_0x536adc,_0x542cae,_0x19858a){return db['Action'][_0x268f('0x48')]({'where':{'id':_0x536adc[_0x268f('0x47')]['id']}})['then'](handleEntityNotFound(_0x542cae,null))['then'](function(_0x38e5bf){if(_0x38e5bf){return _0x38e5bf[_0x268f('0x52')](_0x536adc[_0x268f('0x4a')][_0x268f('0x4d')],_[_0x268f('0x53')](_0x536adc[_0x268f('0x4a')],[_0x268f('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x542cae,null))[_0x268f('0x45')](handleError(_0x542cae,null));};exports['getActions']=function(_0x34da6e,_0x480e31,_0x13af3c){var _0x1d6c0a={};var _0x4709de={};var _0x4748ba;var _0xb37e67;return db[_0x268f('0x2c')][_0x268f('0x4f')]({'where':{'id':_0x34da6e[_0x268f('0x47')]['id']}})[_0x268f('0x26')](handleEntityNotFound(_0x480e31,null))[_0x268f('0x26')](function(_0x4aef8a){if(_0x4aef8a){_0x4748ba=_0x4aef8a;_0x4709de[_0x268f('0x35')]=_[_0x268f('0x32')](db[_0x268f('0x54')][_0x268f('0x2d')]);_0x4709de[_0x268f('0x31')]=_[_0x268f('0x32')](_0x34da6e[_0x268f('0x31')]);_0x4709de[_0x268f('0x3b')]=_['intersection'](_0x4709de[_0x268f('0x35')],_0x4709de[_0x268f('0x31')]);_0x1d6c0a['attributes']=_['intersection'](_0x4709de['model'],qs[_0x268f('0x36')](_0x34da6e['query']['fields']));_0x1d6c0a[_0x268f('0x34')]=_0x1d6c0a[_0x268f('0x34')][_0x268f('0x37')]?_0x1d6c0a['attributes']:_0x4709de[_0x268f('0x35')];_0x1d6c0a[_0x268f('0x50')]=qs[_0x268f('0x39')](_0x34da6e[_0x268f('0x31')]['sort']);_0x1d6c0a[_0x268f('0x3a')]=qs[_0x268f('0x3b')](_['pick'](_0x34da6e['query'],_0x4709de[_0x268f('0x3b')]));if(_0x34da6e[_0x268f('0x31')][_0x268f('0x3d')]){_0x1d6c0a['where']=_['merge'](_0x1d6c0a[_0x268f('0x3a')],{'$or':_['map'](_0x1d6c0a[_0x268f('0x34')],function(_0x2f0c5c){var _0x16609c={};_0x16609c[_0x2f0c5c]={'$like':'%'+_0x34da6e[_0x268f('0x31')][_0x268f('0x3d')]+'%'};return _0x16609c;})});}_0x1d6c0a=_[_0x268f('0x3e')]({},_0x1d6c0a,_0x34da6e[_0x268f('0x40')]);return _0x4748ba[_0x268f('0x55')](_0x1d6c0a);}})[_0x268f('0x26')](function(_0x439f8f){if(_0x439f8f){_0xb37e67=_0x439f8f[_0x268f('0x37')];if(!_0x34da6e[_0x268f('0x31')]['hasOwnProperty'](_0x268f('0x38'))){_0x1d6c0a[_0x268f('0x1d')]=qs[_0x268f('0x1d')](_0x34da6e[_0x268f('0x31')][_0x268f('0x1d')]);_0x1d6c0a[_0x268f('0x1f')]=qs[_0x268f('0x1f')](_0x34da6e['query'][_0x268f('0x1f')]);}return _0x4748ba[_0x268f('0x55')](_0x1d6c0a);}})['then'](function(_0x46c76f){if(_0x46c76f){return _0x46c76f?{'count':_0xb37e67,'rows':_0x46c76f}:null;}})[_0x268f('0x26')](respondWithResult(_0x480e31,null))[_0x268f('0x45')](handleError(_0x480e31,null));};
\ No newline at end of file
+var _0x9fb1=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Automation','includeAll','findAll','rows','show','params','keys','include','catch','create','update','body','find','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x2a3688,_0x3923aa){var _0x255227=function(_0x5d9443){while(--_0x5d9443){_0x2a3688['push'](_0x2a3688['shift']());}};_0x255227(++_0x3923aa);}(_0x9fb1,0x1e6));var _0x19fb=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x9fb1[_0x1cb18a];return _0x22442e;};'use strict';var emlformat=require(_0x19fb('0x0'));var rimraf=require(_0x19fb('0x1'));var zipdir=require(_0x19fb('0x2'));var jsonpatch=require(_0x19fb('0x3'));var rp=require(_0x19fb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x19fb('0x5'));var util=require('util');var path=require(_0x19fb('0x6'));var sox=require(_0x19fb('0x7'));var csv=require(_0x19fb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19fb('0x9'));var _=require('lodash');var squel=require(_0x19fb('0xa'));var crypto=require(_0x19fb('0xb'));var jsforce=require(_0x19fb('0xc'));var deskjs=require(_0x19fb('0xd'));var toCsv=require(_0x19fb('0x8'));var querystring=require('querystring');var Papa=require(_0x19fb('0xe'));var Redis=require(_0x19fb('0xf'));var authService=require(_0x19fb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x19fb('0x11'));var hardwareService=require(_0x19fb('0x12'));var logger=require(_0x19fb('0x13'))(_0x19fb('0x14'));var utils=require(_0x19fb('0x15'));var config=require(_0x19fb('0x16'));var licenseUtil=require(_0x19fb('0x17'));var db=require(_0x19fb('0x18'))['db'];function respondWithStatusCode(_0x39ed49,_0x1fe4b4){_0x1fe4b4=_0x1fe4b4||0xcc;return function(_0x41188a){if(_0x41188a){return _0x39ed49[_0x19fb('0x19')](_0x1fe4b4);}return _0x39ed49[_0x19fb('0x1a')](_0x1fe4b4)[_0x19fb('0x1b')]();};}function respondWithResult(_0x3c627d,_0x8dc8de){_0x8dc8de=_0x8dc8de||0xc8;return function(_0x9de498){if(_0x9de498){return _0x3c627d[_0x19fb('0x1a')](_0x8dc8de)['json'](_0x9de498);}};}function respondWithFilteredResult(_0x4db650,_0xa476f0){return function(_0x10f11e){if(_0x10f11e){var _0x2d2e9c=typeof _0xa476f0[_0x19fb('0x1c')]===_0x19fb('0x1d')&&typeof _0xa476f0[_0x19fb('0x1e')]===_0x19fb('0x1d');var _0x317ccd=_0x10f11e[_0x19fb('0x1f')];var _0x41c719=_0x2d2e9c?0x0:_0xa476f0[_0x19fb('0x1c')];var _0x2d9f11=_0x2d2e9c?_0x10f11e[_0x19fb('0x1f')]:_0xa476f0['offset']+_0xa476f0['limit'];var _0x47266f;if(_0x2d9f11>=_0x317ccd){_0x2d9f11=_0x317ccd;_0x47266f=0xc8;}else{_0x47266f=0xce;}_0x4db650[_0x19fb('0x1a')](_0x47266f);return _0x4db650['set'](_0x19fb('0x20'),_0x41c719+'-'+_0x2d9f11+'/'+_0x317ccd)['json'](_0x10f11e);}return null;};}function patchUpdates(_0x491cd3){return function(_0x20d991){try{jsonpatch[_0x19fb('0x21')](_0x20d991,_0x491cd3,!![]);}catch(_0x3a1bf2){return BPromise[_0x19fb('0x22')](_0x3a1bf2);}return _0x20d991[_0x19fb('0x23')]();};}function saveUpdates(_0x2fc541,_0x231d4d){return function(_0x3737dd){if(_0x3737dd){return _0x3737dd['update'](_0x2fc541)[_0x19fb('0x24')](function(_0x9dc3){return _0x9dc3;});}return null;};}function removeEntity(_0xfd2fd1,_0x288790){return function(_0x364698){if(_0x364698){return _0x364698[_0x19fb('0x25')]()[_0x19fb('0x24')](function(){_0xfd2fd1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xea3758,_0x3fe81c){return function(_0x410c44){if(!_0x410c44){_0xea3758[_0x19fb('0x19')](0x194);}return _0x410c44;};}function handleError(_0x8e3a9b,_0x3e9dff){_0x3e9dff=_0x3e9dff||0x1f4;return function(_0x2d9373){logger['error'](_0x2d9373['stack']);if(_0x2d9373[_0x19fb('0x26')]){delete _0x2d9373[_0x19fb('0x26')];}_0x8e3a9b['status'](_0x3e9dff)['send'](_0x2d9373);};}exports['index']=function(_0x3871c5,_0x50014a){var _0x184741={},_0x1b1e68={},_0x13c556={'count':0x0,'rows':[]};var _0x92f700=_[_0x19fb('0x27')](db['Automation'][_0x19fb('0x28')],function(_0xd4bcf3){return{'name':_0xd4bcf3[_0x19fb('0x29')],'type':_0xd4bcf3['type'][_0x19fb('0x2a')]};});_0x1b1e68[_0x19fb('0x2b')]=_[_0x19fb('0x27')](_0x92f700,'name');_0x1b1e68[_0x19fb('0x2c')]=_['keys'](_0x3871c5[_0x19fb('0x2c')]);_0x1b1e68[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x1b1e68[_0x19fb('0x2b')],_0x1b1e68[_0x19fb('0x2c')]);_0x184741['attributes']=_['intersection'](_0x1b1e68[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x184741[_0x19fb('0x30')]=_0x184741[_0x19fb('0x30')][_0x19fb('0x31')]?_0x184741[_0x19fb('0x30')]:_0x1b1e68['model'];if(!_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x32')]('nolimit')){_0x184741[_0x19fb('0x1e')]=qs[_0x19fb('0x1e')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x184741[_0x19fb('0x1c')]=qs[_0x19fb('0x1c')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x1c')]);}_0x184741[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x184741[_0x19fb('0x35')]=qs[_0x19fb('0x2d')](_[_0x19fb('0x36')](_0x3871c5[_0x19fb('0x2c')],_0x1b1e68['filters']),_0x92f700);if(_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x37')]){_0x184741[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x184741[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x92f700,function(_0x4b60c2){if(_0x4b60c2[_0x19fb('0x39')]!==_0x19fb('0x3a')){var _0x471b26={};_0x471b26[_0x4b60c2[_0x19fb('0x26')]]={'$like':'%'+_0x3871c5[_0x19fb('0x2c')]['filter']+'%'};return _0x471b26;}})});}_0x184741=_[_0x19fb('0x38')]({},_0x184741,_0x3871c5[_0x19fb('0x3b')]);var _0x18e493={'where':_0x184741[_0x19fb('0x35')]};return db[_0x19fb('0x3c')][_0x19fb('0x1f')](_0x18e493)['then'](function(_0x28fbe5){_0x13c556[_0x19fb('0x1f')]=_0x28fbe5;if(_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x3d')]){_0x184741['include']=[{'all':!![]}];}return db['Automation'][_0x19fb('0x3e')](_0x184741);})[_0x19fb('0x24')](function(_0x402473){_0x13c556[_0x19fb('0x3f')]=_0x402473;return _0x13c556;})[_0x19fb('0x24')](respondWithFilteredResult(_0x50014a,_0x184741))['catch'](handleError(_0x50014a,null));};exports[_0x19fb('0x40')]=function(_0x2b4f3d,_0x5d946a){var _0x222b4b={'raw':![],'where':{'id':_0x2b4f3d[_0x19fb('0x41')]['id']}},_0x5becee={};_0x5becee[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x3c')][_0x19fb('0x28')]);_0x5becee[_0x19fb('0x2c')]=_[_0x19fb('0x42')](_0x2b4f3d[_0x19fb('0x2c')]);_0x5becee[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x5becee[_0x19fb('0x2b')],_0x5becee[_0x19fb('0x2c')]);_0x222b4b[_0x19fb('0x30')]=_[_0x19fb('0x2e')](_0x5becee[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x2b4f3d['query'][_0x19fb('0x2f')]));_0x222b4b[_0x19fb('0x30')]=_0x222b4b[_0x19fb('0x30')]['length']?_0x222b4b['attributes']:_0x5becee[_0x19fb('0x2b')];if(_0x2b4f3d[_0x19fb('0x2c')][_0x19fb('0x3d')]){_0x222b4b[_0x19fb('0x43')]=[{'all':!![]}];}_0x222b4b=_[_0x19fb('0x38')]({},_0x222b4b,_0x2b4f3d['options']);return db[_0x19fb('0x3c')]['find'](_0x222b4b)[_0x19fb('0x24')](handleEntityNotFound(_0x5d946a,null))[_0x19fb('0x24')](respondWithResult(_0x5d946a,null))[_0x19fb('0x44')](handleError(_0x5d946a,null));};exports[_0x19fb('0x45')]=function(_0xaeee6,_0x2ff938){return db[_0x19fb('0x3c')][_0x19fb('0x45')](_0xaeee6['body'],{})[_0x19fb('0x24')](respondWithResult(_0x2ff938,0xc9))[_0x19fb('0x44')](handleError(_0x2ff938,null));};exports[_0x19fb('0x46')]=function(_0xc65755,_0x109e07){if(_0xc65755[_0x19fb('0x47')]['id']){delete _0xc65755[_0x19fb('0x47')]['id'];}return db[_0x19fb('0x3c')][_0x19fb('0x48')]({'where':{'id':_0xc65755['params']['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x109e07,null))['then'](saveUpdates(_0xc65755[_0x19fb('0x47')],null))['then'](respondWithResult(_0x109e07,null))['catch'](handleError(_0x109e07,null));};exports[_0x19fb('0x25')]=function(_0x22bdb4,_0x335a64){return db['Automation'][_0x19fb('0x48')]({'where':{'id':_0x22bdb4[_0x19fb('0x41')]['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x335a64,null))[_0x19fb('0x24')](removeEntity(_0x335a64,null))['catch'](handleError(_0x335a64,null));};exports[_0x19fb('0x49')]=function(_0x33adb2,_0x47bb07,_0x2e1791){return db[_0x19fb('0x4a')]['find']({'where':{'id':_0x33adb2['params']['id']}})['then'](handleEntityNotFound(_0x47bb07,null))[_0x19fb('0x24')](function(_0xa05b4e){if(_0xa05b4e){return _0xa05b4e[_0x19fb('0x49')](_0x33adb2[_0x19fb('0x47')][_0x19fb('0x4b')],_[_0x19fb('0x4c')](_0x33adb2[_0x19fb('0x47')],[_0x19fb('0x4b'),'id'])||{});}})[_0x19fb('0x24')](respondWithResult(_0x47bb07,null))[_0x19fb('0x44')](handleError(_0x47bb07,null));};exports[_0x19fb('0x4d')]=function(_0x343f69,_0x397f13,_0x439524){var _0x4736c8={};var _0x39c152={};var _0x4111e2;var _0x186164;return db[_0x19fb('0x3c')][_0x19fb('0x4e')]({'where':{'id':_0x343f69[_0x19fb('0x41')]['id']}})['then'](handleEntityNotFound(_0x397f13,null))['then'](function(_0x586dd8){if(_0x586dd8){_0x4111e2=_0x586dd8;_0x39c152[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x4a')][_0x19fb('0x28')]);_0x39c152[_0x19fb('0x2c')]=_[_0x19fb('0x42')](_0x343f69[_0x19fb('0x2c')]);_0x39c152[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x39c152[_0x19fb('0x2b')],_0x39c152[_0x19fb('0x2c')]);_0x4736c8[_0x19fb('0x30')]=_[_0x19fb('0x2e')](_0x39c152[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x4736c8[_0x19fb('0x30')]=_0x4736c8[_0x19fb('0x30')][_0x19fb('0x31')]?_0x4736c8[_0x19fb('0x30')]:_0x39c152[_0x19fb('0x2b')];_0x4736c8[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x4736c8[_0x19fb('0x35')]=qs[_0x19fb('0x2d')](_[_0x19fb('0x36')](_0x343f69[_0x19fb('0x2c')],_0x39c152[_0x19fb('0x2d')]));if(_0x343f69['query']['filter']){_0x4736c8[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x4736c8[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x4736c8[_0x19fb('0x30')],function(_0x1810fd){var _0x2221d2={};_0x2221d2[_0x1810fd]={'$like':'%'+_0x343f69['query']['filter']+'%'};return _0x2221d2;})});}_0x4736c8=_['merge']({},_0x4736c8,_0x343f69[_0x19fb('0x3b')]);return _0x4111e2['getConditions'](_0x4736c8);}})[_0x19fb('0x24')](function(_0x36ec66){if(_0x36ec66){_0x186164=_0x36ec66[_0x19fb('0x31')];if(!_0x343f69[_0x19fb('0x2c')][_0x19fb('0x32')](_0x19fb('0x4f'))){_0x4736c8['limit']=qs['limit'](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x4736c8[_0x19fb('0x1c')]=qs['offset'](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x1c')]);}return _0x4111e2[_0x19fb('0x4d')](_0x4736c8);}})[_0x19fb('0x24')](function(_0x42e115){if(_0x42e115){return _0x42e115?{'count':_0x186164,'rows':_0x42e115}:null;}})[_0x19fb('0x24')](respondWithResult(_0x397f13,null))[_0x19fb('0x44')](handleError(_0x397f13,null));};exports['addActions']=function(_0x16387c,_0x550b6c,_0xaf0ac7){return db[_0x19fb('0x50')]['find']({'where':{'id':_0x16387c[_0x19fb('0x41')]['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x550b6c,null))['then'](function(_0x4fb6cb){if(_0x4fb6cb){return _0x4fb6cb[_0x19fb('0x51')](_0x16387c['body'][_0x19fb('0x4b')],_['omit'](_0x16387c[_0x19fb('0x47')],[_0x19fb('0x4b'),'id'])||{});}})[_0x19fb('0x24')](respondWithResult(_0x550b6c,null))[_0x19fb('0x44')](handleError(_0x550b6c,null));};exports[_0x19fb('0x52')]=function(_0x5563b1,_0x4e0350,_0x1e155c){var _0x3f0a3b={};var _0x49f0ee={};var _0x8d460a;var _0x281c8c;return db[_0x19fb('0x3c')][_0x19fb('0x4e')]({'where':{'id':_0x5563b1[_0x19fb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e0350,null))[_0x19fb('0x24')](function(_0x424aae){if(_0x424aae){_0x8d460a=_0x424aae;_0x49f0ee[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x50')][_0x19fb('0x28')]);_0x49f0ee[_0x19fb('0x2c')]=_['keys'](_0x5563b1[_0x19fb('0x2c')]);_0x49f0ee['filters']=_['intersection'](_0x49f0ee[_0x19fb('0x2b')],_0x49f0ee[_0x19fb('0x2c')]);_0x3f0a3b[_0x19fb('0x30')]=_['intersection'](_0x49f0ee[_0x19fb('0x2b')],qs['fields'](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x3f0a3b[_0x19fb('0x30')]=_0x3f0a3b[_0x19fb('0x30')][_0x19fb('0x31')]?_0x3f0a3b[_0x19fb('0x30')]:_0x49f0ee[_0x19fb('0x2b')];_0x3f0a3b[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x3f0a3b[_0x19fb('0x35')]=qs['filters'](_['pick'](_0x5563b1[_0x19fb('0x2c')],_0x49f0ee[_0x19fb('0x2d')]));if(_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x37')]){_0x3f0a3b[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x3f0a3b[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x3f0a3b[_0x19fb('0x30')],function(_0x510f6c){var _0x29cf26={};_0x29cf26[_0x510f6c]={'$like':'%'+_0x5563b1['query'][_0x19fb('0x37')]+'%'};return _0x29cf26;})});}_0x3f0a3b=_[_0x19fb('0x38')]({},_0x3f0a3b,_0x5563b1[_0x19fb('0x3b')]);return _0x8d460a[_0x19fb('0x52')](_0x3f0a3b);}})[_0x19fb('0x24')](function(_0x50dd79){if(_0x50dd79){_0x281c8c=_0x50dd79[_0x19fb('0x31')];if(!_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x32')](_0x19fb('0x4f'))){_0x3f0a3b['limit']=qs[_0x19fb('0x1e')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x3f0a3b[_0x19fb('0x1c')]=qs[_0x19fb('0x1c')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x1c')]);}return _0x8d460a['getActions'](_0x3f0a3b);}})[_0x19fb('0x24')](function(_0x791811){if(_0x791811){return _0x791811?{'count':_0x281c8c,'rows':_0x791811}:null;}})[_0x19fb('0x24')](respondWithResult(_0x4e0350,null))['catch'](handleError(_0x4e0350,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 0c38671..bfb4c7f 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 _0xaf36=['exports','define','Automation','tools_automations','moment','request-promise','path','./automation.attributes'];(function(_0x1eab4a,_0x1aebee){var _0x10b991=function(_0x416dba){while(--_0x416dba){_0x1eab4a['push'](_0x1eab4a['shift']());}};_0x10b991(++_0x1aebee);}(_0xaf36,0xb4));var _0x6af3=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0xaf36[_0x127a60];return _0xc1f6a3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6af3('0x0'));var BPromise=require('bluebird');var rp=require(_0x6af3('0x1'));var fs=require('fs');var path=require(_0x6af3('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6af3('0x3'));module[_0x6af3('0x4')]=function(_0x4ac981,_0x23d387){return _0x4ac981[_0x6af3('0x5')](_0x6af3('0x6'),attributes,{'tableName':_0x6af3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x90d0=['rimraf','../../config/environment','./automation.attributes','exports','Automation','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x45df3d,_0x3be0d8){var _0x33f6bd=function(_0x21b6af){while(--_0x21b6af){_0x45df3d['push'](_0x45df3d['shift']());}};_0x33f6bd(++_0x3be0d8);}(_0x90d0,0x73));var _0x090d=function(_0x2545d0,_0x397e79){_0x2545d0=_0x2545d0-0x0;var _0x10111b=_0x90d0[_0x2545d0];return _0x10111b;};'use strict';var _=require(_0x090d('0x0'));var util=require(_0x090d('0x1'));var logger=require(_0x090d('0x2'))(_0x090d('0x3'));var moment=require(_0x090d('0x4'));var BPromise=require(_0x090d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x090d('0x6'));var config=require(_0x090d('0x7'));var attributes=require(_0x090d('0x8'));module[_0x090d('0x9')]=function(_0x3be0f9,_0x3e4912){return _0x3be0f9['define'](_0x090d('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 84bb1a4..4d3bfb3 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 _0x2f56=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1e55d9,_0x5ce14a){var _0x6dc799=function(_0x383e7b){while(--_0x383e7b){_0x1e55d9['push'](_0x1e55d9['shift']());}};_0x6dc799(++_0x5ce14a);}(_0x2f56,0xb5));var _0x62f5=function(_0x40d8f2,_0x303920){_0x40d8f2=_0x40d8f2-0x0;var _0x32d122=_0x2f56[_0x40d8f2];return _0x32d122;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var moment=require(_0x62f5('0x2'));var BPromise=require(_0x62f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f5('0x4'));var db=require(_0x62f5('0x5'))['db'];var utils=require(_0x62f5('0x6'));var logger=require(_0x62f5('0x7'))(_0x62f5('0x8'));var config=require('../../config/environment');var jayson=require(_0x62f5('0x9'));var client=jayson[_0x62f5('0xa')][_0x62f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x387150,_0x58ae99,_0x3ee814){return new BPromise(function(_0xc11beb,_0x505bfd){return client[_0x62f5('0xc')](_0x387150,_0x3ee814)[_0x62f5('0xd')](function(_0x4a3621){logger[_0x62f5('0xe')](_0x62f5('0xf'),_0x58ae99,_0x62f5('0x10'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x58ae99,_0x62f5('0x10'),JSON[_0x62f5('0x11')](_0x4a3621));if(_0x4a3621[_0x62f5('0x12')]){if(_0x4a3621[_0x62f5('0x12')][_0x62f5('0x13')]===0x1f4){logger[_0x62f5('0x12')](_0x62f5('0xf'),_0x58ae99,_0x4a3621['error'][_0x62f5('0x14')]);return _0x505bfd(_0x4a3621['error'][_0x62f5('0x14')]);}logger[_0x62f5('0x12')](_0x62f5('0xf'),_0x58ae99,_0x4a3621[_0x62f5('0x12')]['message']);return _0xc11beb(_0x4a3621[_0x62f5('0x12')]['message']);}else{logger[_0x62f5('0xe')](_0x62f5('0xf'),_0x58ae99,_0x62f5('0x10'));_0xc11beb(_0x4a3621[_0x62f5('0x15')][_0x62f5('0x14')]);}})[_0x62f5('0x16')](function(_0x2756cb){logger[_0x62f5('0x12')]('Automation,\x20%s,\x20%s',_0x58ae99,_0x2756cb);_0x505bfd(_0x2756cb);});});}
\ No newline at end of file
+var _0xa03c=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5015cc,_0x35eb6b){var _0xa4fd74=function(_0x3d4cfe){while(--_0x3d4cfe){_0x5015cc['push'](_0x5015cc['shift']());}};_0xa4fd74(++_0x35eb6b);}(_0xa03c,0x94));var _0xca03=function(_0x1965df,_0x275b26){_0x1965df=_0x1965df-0x0;var _0x4a5ed6=_0xa03c[_0x1965df];return _0x4a5ed6;};'use strict';var _=require(_0xca03('0x0'));var util=require('util');var moment=require(_0xca03('0x1'));var BPromise=require(_0xca03('0x2'));var rs=require(_0xca03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca03('0x4'))['db'];var utils=require(_0xca03('0x5'));var logger=require(_0xca03('0x6'))('rpc');var config=require(_0xca03('0x7'));var jayson=require(_0xca03('0x8'));var client=jayson[_0xca03('0x9')][_0xca03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27aac6,_0x9d2b3d,_0x52f12e){return new BPromise(function(_0x1832cc,_0x18ddee){return client[_0xca03('0xb')](_0x27aac6,_0x52f12e)[_0xca03('0xc')](function(_0x31e7be){logger[_0xca03('0xd')](_0xca03('0xe'),_0x9d2b3d,_0xca03('0xf'));logger[_0xca03('0x10')](_0xca03('0x11'),_0x9d2b3d,'request\x20sent',JSON[_0xca03('0x12')](_0x31e7be));if(_0x31e7be[_0xca03('0x13')]){if(_0x31e7be[_0xca03('0x13')][_0xca03('0x14')]===0x1f4){logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);return _0x18ddee(_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);}logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);return _0x1832cc(_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);}else{logger[_0xca03('0xd')](_0xca03('0xe'),_0x9d2b3d,_0xca03('0xf'));_0x1832cc(_0x31e7be['result'][_0xca03('0x15')]);}})[_0xca03('0x16')](function(_0x184313){logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x184313);_0x18ddee(_0x184313);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 755f971..2cacc5b 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 _0xbe27=['get','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index'];(function(_0x33418c,_0x342219){var _0x1d2264=function(_0x379fed){while(--_0x379fed){_0x33418c['push'](_0x33418c['shift']());}};_0x1d2264(++_0x342219);}(_0xbe27,0x12d));var _0x7be2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xbe27[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0x7be2('0x0'));var path=require(_0x7be2('0x1'));var timeout=require('connect-timeout');var express=require(_0x7be2('0x2'));var router=express[_0x7be2('0x3')]();var fs_extra=require(_0x7be2('0x4'));var auth=require(_0x7be2('0x5'));var interaction=require(_0x7be2('0x6'));var config=require(_0x7be2('0x7'));var controller=require(_0x7be2('0x8'));router['get']('/',auth[_0x7be2('0x9')](),controller[_0x7be2('0xa')]);router[_0x7be2('0xb')]('/:id',auth[_0x7be2('0x9')](),controller[_0x7be2('0xc')]);router['get'](_0x7be2('0xd'),auth[_0x7be2('0x9')](),controller[_0x7be2('0xe')]);router[_0x7be2('0xb')](_0x7be2('0xf'),auth[_0x7be2('0x9')](),controller[_0x7be2('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7be2('0x11')](_0x7be2('0xd'),auth[_0x7be2('0x9')](),controller[_0x7be2('0x12')]);router['post'](_0x7be2('0xf'),auth['isAuthenticated'](),controller[_0x7be2('0x13')]);router[_0x7be2('0x14')](_0x7be2('0x15'),auth[_0x7be2('0x9')](),controller[_0x7be2('0x16')]);router[_0x7be2('0x17')](_0x7be2('0x15'),auth['isAuthenticated'](),controller[_0x7be2('0x18')]);module[_0x7be2('0x19')]=router;
\ No newline at end of file
+var _0x4a99=['./automation.controller','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','get','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x287428,_0x5a62c2){var _0x5169c2=function(_0x5c4aee){while(--_0x5c4aee){_0x287428['push'](_0x287428['shift']());}};_0x5169c2(++_0x5a62c2);}(_0x4a99,0x1aa));var _0x94a9=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x4a99[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0x94a9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x94a9('0x1'));var express=require(_0x94a9('0x2'));var router=express['Router']();var fs_extra=require(_0x94a9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x94a9('0x4'));var config=require(_0x94a9('0x5'));var controller=require(_0x94a9('0x6'));router['get']('/',auth[_0x94a9('0x7')](),controller[_0x94a9('0x8')]);router['get'](_0x94a9('0x9'),auth[_0x94a9('0x7')](),controller[_0x94a9('0xa')]);router['get'](_0x94a9('0xb'),auth['isAuthenticated'](),controller[_0x94a9('0xc')]);router[_0x94a9('0xd')](_0x94a9('0xe'),auth[_0x94a9('0x7')](),controller[_0x94a9('0xf')]);router['post']('/',auth[_0x94a9('0x7')](),controller[_0x94a9('0x10')]);router[_0x94a9('0x11')](_0x94a9('0xb'),auth[_0x94a9('0x7')](),controller[_0x94a9('0x12')]);router[_0x94a9('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x94a9('0x13')]);router[_0x94a9('0x14')](_0x94a9('0x9'),auth[_0x94a9('0x7')](),controller[_0x94a9('0x15')]);router[_0x94a9('0x16')](_0x94a9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x94a9('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 663dc2e..32cf218 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 _0x2b65=['ivr','BOOLEAN','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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM'];(function(_0x10f2d6,_0x2813e2){var _0x54eebb=function(_0x25dbb2){while(--_0x25dbb2){_0x10f2d6['push'](_0x10f2d6['shift']());}};_0x54eebb(++_0x2813e2);}(_0x2b65,0xc3));var _0x52b6=function(_0x334570,_0x23d405){_0x334570=_0x334570-0x0;var _0x45c6dc=_0x2b65[_0x334570];return _0x45c6dc;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'name':{'type':Sequelize[_0x52b6('0x2')],'unique':_0x52b6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x52b6('0x4')](_0x52b6('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x52b6('0x2')]},'active':{'type':Sequelize[_0x52b6('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x52b6('0x7')](0x4)[_0x52b6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x52b6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x52b6('0x7')](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'comment':_0x52b6('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x52b6('0xf')},'dialTimezone':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':_0x52b6('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x52b6('0x4')](_0x52b6('0x11'),_0x52b6('0x12'),_0x52b6('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x52b6('0x6')],'defaultValue':0x0,'comment':_0x52b6('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x52b6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x52b6('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x52b6('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x52b6('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x52b6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x52b6('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x52b6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x52b6('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x52b6('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x52b6('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x52b6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x52b6('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x52b6('0x7')](0x9)[_0x52b6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x52b6('0x1d'),_0x52b6('0x1e')),'defaultValue':_0x52b6('0x1d')},'dialPrefix':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x52b6('0x1f')},'dialCutDigit':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x52b6('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x52b6('0x7')](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0x22')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x52b6('0x7')](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0x25')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x52b6('0x7')](0x3)[_0x52b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x52b6('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x52b6('0x7')](0x5)[_0x52b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x52b6('0x27')}};
\ No newline at end of file
+var _0x03e5=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\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)'];(function(_0x4a7977,_0x4b0931){var _0x3c8a0d=function(_0x2c3977){while(--_0x2c3977){_0x4a7977['push'](_0x4a7977['shift']());}};_0x3c8a0d(++_0x4b0931);}(_0x03e5,0x64));var _0x503e=function(_0x5da55f,_0x2428f7){_0x5da55f=_0x5da55f-0x0;var _0x13c392=_0x03e5[_0x5da55f];return _0x13c392;};'use strict';var Sequelize=require(_0x503e('0x0'));module['exports']={'name':{'type':Sequelize[_0x503e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x503e('0x2')](_0x503e('0x3')),'allowNull':![],'defaultValue':_0x503e('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x503e('0x4')],'defaultValue':0x0,'comment':_0x503e('0x5')},'limitCalls':{'type':Sequelize[_0x503e('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x503e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x503e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x503e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'comment':_0x503e('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x503e('0xf')},'dialTimezone':{'type':Sequelize[_0x503e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x503e('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x503e('0x2')](_0x503e('0x11'),_0x503e('0x12'),'onlyIfOpen'),'defaultValue':_0x503e('0x11')},'dialAMDActive':{'type':Sequelize[_0x503e('0x4')],'defaultValue':0x0,'comment':_0x503e('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x503e('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x503e('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x503e('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x503e('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x503e('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x503e('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x503e('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x503e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x503e('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x503e('0x2')]('DESC',_0x503e('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x503e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x503e('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x503e('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x503e('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 42e5218..4fa0aca 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 _0xb57d=['index','map','Campaign','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','getHoppers','findOne','pick','CmHopper','rows','getHopperHistories','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','error','name','send'];(function(_0xce014b,_0x2c69f4){var _0x1a7d81=function(_0x51b2bb){while(--_0x51b2bb){_0xce014b['push'](_0xce014b['shift']());}};_0x1a7d81(++_0x2c69f4);}(_0xb57d,0x18d));var _0xdb57=function(_0x55b7b0,_0x2df366){_0x55b7b0=_0x55b7b0-0x0;var _0x231f56=_0xb57d[_0x55b7b0];return _0x231f56;};'use strict';var emlformat=require(_0xdb57('0x0'));var rimraf=require(_0xdb57('0x1'));var zipdir=require(_0xdb57('0x2'));var jsonpatch=require(_0xdb57('0x3'));var rp=require(_0xdb57('0x4'));var moment=require('moment');var BPromise=require(_0xdb57('0x5'));var Mustache=require(_0xdb57('0x6'));var util=require(_0xdb57('0x7'));var path=require(_0xdb57('0x8'));var sox=require('sox');var csv=require(_0xdb57('0x9'));var ejs=require(_0xdb57('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb57('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdb57('0xc'));var deskjs=require(_0xdb57('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdb57('0xe'));var Redis=require(_0xdb57('0xf'));var authService=require(_0xdb57('0x10'));var qs=require(_0xdb57('0x11'));var as=require(_0xdb57('0x12'));var hardwareService=require(_0xdb57('0x13'));var logger=require('../../config/logger')(_0xdb57('0x14'));var utils=require('../../config/utils');var config=require(_0xdb57('0x15'));var licenseUtil=require(_0xdb57('0x16'));var db=require(_0xdb57('0x17'))['db'];function respondWithStatusCode(_0x1f83a7,_0x52fcf9){_0x52fcf9=_0x52fcf9||0xcc;return function(_0x5c8870){if(_0x5c8870){return _0x1f83a7[_0xdb57('0x18')](_0x52fcf9);}return _0x1f83a7[_0xdb57('0x19')](_0x52fcf9)[_0xdb57('0x1a')]();};}function respondWithResult(_0x5f311a,_0x201fde){_0x201fde=_0x201fde||0xc8;return function(_0x25a660){if(_0x25a660){return _0x5f311a[_0xdb57('0x19')](_0x201fde)[_0xdb57('0x1b')](_0x25a660);}};}function respondWithFilteredResult(_0x3c5178,_0x4fae19){return function(_0x42924f){if(_0x42924f){var _0x42f86a=typeof _0x4fae19[_0xdb57('0x1c')]===_0xdb57('0x1d')&&typeof _0x4fae19['limit']===_0xdb57('0x1d');var _0x54e7b4=_0x42924f[_0xdb57('0x1e')];var _0x14b4f0=_0x42f86a?0x0:_0x4fae19[_0xdb57('0x1c')];var _0x3858b2=_0x42f86a?_0x42924f['count']:_0x4fae19[_0xdb57('0x1c')]+_0x4fae19[_0xdb57('0x1f')];var _0x2df673;if(_0x3858b2>=_0x54e7b4){_0x3858b2=_0x54e7b4;_0x2df673=0xc8;}else{_0x2df673=0xce;}_0x3c5178['status'](_0x2df673);return _0x3c5178['set'](_0xdb57('0x20'),_0x14b4f0+'-'+_0x3858b2+'/'+_0x54e7b4)[_0xdb57('0x1b')](_0x42924f);}return null;};}function patchUpdates(_0x4ee3af){return function(_0x48b941){try{jsonpatch[_0xdb57('0x21')](_0x48b941,_0x4ee3af,!![]);}catch(_0x579614){return BPromise[_0xdb57('0x22')](_0x579614);}return _0x48b941[_0xdb57('0x23')]();};}function saveUpdates(_0x416fc6,_0x582607){return function(_0x1f4c0d){if(_0x1f4c0d){return _0x1f4c0d[_0xdb57('0x24')](_0x416fc6)[_0xdb57('0x25')](function(_0x43841f){return _0x43841f;});}return null;};}function removeEntity(_0x3a1755,_0x436f76){return function(_0x141768){if(_0x141768){return _0x141768[_0xdb57('0x26')]()[_0xdb57('0x25')](function(){var _0x55e28a=_0x141768['get']({'plain':!![]});var _0x528ac8=_0xdb57('0x27');return db[_0xdb57('0x28')]['destroy']({'where':{'type':_0x528ac8,'resourceId':_0x55e28a['id']}})[_0xdb57('0x25')](function(){return _0x141768;});})[_0xdb57('0x25')](function(){_0x3a1755[_0xdb57('0x19')](0xcc)[_0xdb57('0x1a')]();});}};}function handleEntityNotFound(_0x38216c,_0x53fba1){return function(_0x3c9d8f){if(!_0x3c9d8f){_0x38216c[_0xdb57('0x18')](0x194);}return _0x3c9d8f;};}function handleError(_0x2185b9,_0x2a9311){_0x2a9311=_0x2a9311||0x1f4;return function(_0x51d0f0){logger[_0xdb57('0x29')](_0x51d0f0['stack']);if(_0x51d0f0[_0xdb57('0x2a')]){delete _0x51d0f0['name'];}_0x2185b9[_0xdb57('0x19')](_0x2a9311)[_0xdb57('0x2b')](_0x51d0f0);};}exports[_0xdb57('0x2c')]=function(_0x445a78,_0x2aee4f){var _0x1c1895={},_0x563ed9={},_0x17af2c={'count':0x0,'rows':[]};var _0x30817e=_[_0xdb57('0x2d')](db[_0xdb57('0x2e')][_0xdb57('0x2f')],function(_0x185499){return{'name':_0x185499['fieldName'],'type':_0x185499[_0xdb57('0x30')][_0xdb57('0x31')]};});_0x563ed9[_0xdb57('0x32')]=_[_0xdb57('0x2d')](_0x30817e,_0xdb57('0x2a'));_0x563ed9['query']=_[_0xdb57('0x33')](_0x445a78[_0xdb57('0x34')]);_0x563ed9['filters']=_[_0xdb57('0x35')](_0x563ed9[_0xdb57('0x32')],_0x563ed9[_0xdb57('0x34')]);_0x1c1895[_0xdb57('0x36')]=_['intersection'](_0x563ed9[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x445a78[_0xdb57('0x34')][_0xdb57('0x37')]));_0x1c1895[_0xdb57('0x36')]=_0x1c1895[_0xdb57('0x36')][_0xdb57('0x38')]?_0x1c1895[_0xdb57('0x36')]:_0x563ed9['model'];if(!_0x445a78['query'][_0xdb57('0x39')](_0xdb57('0x3a'))){_0x1c1895[_0xdb57('0x1f')]=qs[_0xdb57('0x1f')](_0x445a78[_0xdb57('0x34')][_0xdb57('0x1f')]);_0x1c1895[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x445a78[_0xdb57('0x34')][_0xdb57('0x1c')]);}_0x1c1895[_0xdb57('0x3b')]=qs[_0xdb57('0x3c')](_0x445a78[_0xdb57('0x34')][_0xdb57('0x3c')]);_0x1c1895[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_['pick'](_0x445a78['query'],_0x563ed9[_0xdb57('0x3e')]),_0x30817e);if(_0x445a78[_0xdb57('0x34')]['filter']){_0x1c1895[_0xdb57('0x3d')]=_[_0xdb57('0x3f')](_0x1c1895[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x30817e,function(_0x409397){if(_0x409397['type']!==_0xdb57('0x40')){var _0x155d4c={};_0x155d4c[_0x409397[_0xdb57('0x2a')]]={'$like':'%'+_0x445a78[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x155d4c;}})});}_0x1c1895=_[_0xdb57('0x3f')]({},_0x1c1895,_0x445a78['options']);var _0x453be5={'where':_0x1c1895[_0xdb57('0x3d')]};return db[_0xdb57('0x2e')]['count'](_0x453be5)[_0xdb57('0x25')](function(_0x4bbf26){_0x17af2c[_0xdb57('0x1e')]=_0x4bbf26;if(_0x445a78[_0xdb57('0x34')][_0xdb57('0x42')]){_0x1c1895[_0xdb57('0x43')]=[{'all':!![]}];}return db[_0xdb57('0x2e')][_0xdb57('0x44')](_0x1c1895);})[_0xdb57('0x25')](function(_0x3889d3){_0x17af2c['rows']=_0x3889d3;return _0x17af2c;})[_0xdb57('0x25')](respondWithFilteredResult(_0x2aee4f,_0x1c1895))['catch'](handleError(_0x2aee4f,null));};exports[_0xdb57('0x45')]=function(_0x3632f4,_0x307914){var _0x93b61a={'raw':![],'where':{'id':_0x3632f4[_0xdb57('0x46')]['id']}},_0x32f7fa={};_0x32f7fa[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x2e')][_0xdb57('0x2f')]);_0x32f7fa[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x3632f4[_0xdb57('0x34')]);_0x32f7fa['filters']=_[_0xdb57('0x35')](_0x32f7fa['model'],_0x32f7fa[_0xdb57('0x34')]);_0x93b61a[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x32f7fa[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x3632f4[_0xdb57('0x34')][_0xdb57('0x37')]));_0x93b61a[_0xdb57('0x36')]=_0x93b61a[_0xdb57('0x36')]['length']?_0x93b61a['attributes']:_0x32f7fa[_0xdb57('0x32')];if(_0x3632f4['query']['includeAll']){_0x93b61a[_0xdb57('0x43')]=[{'all':!![]}];}_0x93b61a=_[_0xdb57('0x3f')]({},_0x93b61a,_0x3632f4[_0xdb57('0x47')]);return db[_0xdb57('0x2e')][_0xdb57('0x48')](_0x93b61a)[_0xdb57('0x25')](handleEntityNotFound(_0x307914,null))['then'](respondWithResult(_0x307914,null))['catch'](handleError(_0x307914,null));};exports[_0xdb57('0x49')]=function(_0x45a990,_0x5f3653){return db[_0xdb57('0x2e')][_0xdb57('0x49')](_0x45a990[_0xdb57('0x4a')],{})[_0xdb57('0x25')](function(_0x1c2df0){var _0xdd5329=_0x45a990[_0xdb57('0x4b')][_0xdb57('0x4c')]({'plain':!![]});if(!_0xdd5329)throw new Error(_0xdb57('0x4d'));if(_0xdd5329[_0xdb57('0x4e')]===_0xdb57('0x4b')){var _0x230d68=_0x1c2df0[_0xdb57('0x4c')]({'plain':!![]});var _0x78202b='IvrCampaigns';return db[_0xdb57('0x4f')][_0xdb57('0x48')]({'where':{'name':_0x78202b,'userProfileId':_0xdd5329['userProfileId']},'raw':!![]})[_0xdb57('0x25')](function(_0x196be2){if(_0x196be2&&_0x196be2[_0xdb57('0x50')]===0x0){return db[_0xdb57('0x28')][_0xdb57('0x49')]({'name':_0x230d68[_0xdb57('0x2a')],'resourceId':_0x230d68['id'],'type':_0x196be2[_0xdb57('0x2a')],'sectionId':_0x196be2['id']},{})[_0xdb57('0x25')](function(){return _0x1c2df0;});}else{return _0x1c2df0;}})[_0xdb57('0x51')](function(_0x30868b){logger[_0xdb57('0x29')](_0xdb57('0x52'),_0x30868b);throw _0x30868b;});}return _0x1c2df0;})['then'](respondWithResult(_0x5f3653,0xc9))[_0xdb57('0x51')](handleError(_0x5f3653,null));};exports['clone']=function(_0x32c7a2,_0x1ff555){var _0x22ab41={'where':{'id':_0x32c7a2[_0xdb57('0x46')]['id']}},_0x4f283c={};_0x4f283c['model']=_[_0xdb57('0x33')](db[_0xdb57('0x2e')][_0xdb57('0x2f')]);_0x22ab41[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x4f283c[_0xdb57('0x32')],qs['fields'](_0x32c7a2[_0xdb57('0x34')][_0xdb57('0x37')]));_0x22ab41[_0xdb57('0x36')]=_0x22ab41['attributes'][_0xdb57('0x38')]?_0x22ab41[_0xdb57('0x36')]:_0x4f283c[_0xdb57('0x32')];if(_0x32c7a2[_0xdb57('0x34')]['includeAll']){_0x22ab41[_0xdb57('0x43')]=[{'all':!![]}];}_0x22ab41=_[_0xdb57('0x3f')]({},_0x22ab41,_0x32c7a2[_0xdb57('0x47')]);return db[_0xdb57('0x2e')][_0xdb57('0x48')](_0x22ab41)[_0xdb57('0x25')](handleEntityNotFound(_0x1ff555,null))['then'](function(_0x19820e){if(_0x19820e){var _0x44f5c4=_0x19820e[_0xdb57('0x4c')]({'plain':!![]});_0x44f5c4=qs[_0xdb57('0x53')](_0x44f5c4,['id',_0xdb57('0x54'),_0xdb57('0x55')]);_0x32c7a2[_0xdb57('0x4a')]=_['omit'](_0x32c7a2[_0xdb57('0x4a')],['id',_0xdb57('0x54'),_0xdb57('0x55')]);return db[_0xdb57('0x2e')]['create'](_[_0xdb57('0x3f')](_0x44f5c4,_0x32c7a2[_0xdb57('0x4a')]),{'include':_0x32c7a2[_0xdb57('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xdb57('0x25')](function(_0x4d5262){var _0x49bce4=_0x32c7a2[_0xdb57('0x4b')][_0xdb57('0x4c')]({'plain':!![]});if(!_0x49bce4)throw new Error(_0xdb57('0x4d'));if(_0x49bce4[_0xdb57('0x4e')]===_0xdb57('0x4b')){var _0x49524e=_0x4d5262[_0xdb57('0x4c')]({'plain':!![]});var _0xa53c2c=_0xdb57('0x27');return db[_0xdb57('0x4f')]['find']({'where':{'name':_0xa53c2c,'userProfileId':_0x49bce4['userProfileId']},'raw':!![]})[_0xdb57('0x25')](function(_0xc456b6){if(_0xc456b6&&_0xc456b6[_0xdb57('0x50')]===0x0){return db[_0xdb57('0x28')][_0xdb57('0x49')]({'name':_0x49524e[_0xdb57('0x2a')],'resourceId':_0x49524e['id'],'type':_0xc456b6['name'],'sectionId':_0xc456b6['id']},{})[_0xdb57('0x25')](function(){return _0x4d5262;});}else{return _0x4d5262;}})[_0xdb57('0x51')](function(_0x5f4194){logger[_0xdb57('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f4194);throw _0x5f4194;});}return _0x4d5262;});}})[_0xdb57('0x25')](respondWithResult(_0x1ff555,0xc9))[_0xdb57('0x51')](handleError(_0x1ff555,null));};exports[_0xdb57('0x24')]=function(_0x32fffe,_0x11918e){if(_0x32fffe[_0xdb57('0x4a')]['id']){delete _0x32fffe['body']['id'];}return db['Campaign'][_0xdb57('0x48')]({'where':{'id':_0x32fffe[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x11918e,null))['then'](saveUpdates(_0x32fffe[_0xdb57('0x4a')],null))[_0xdb57('0x25')](respondWithResult(_0x11918e,null))['catch'](handleError(_0x11918e,null));};exports[_0xdb57('0x26')]=function(_0x5db407,_0x29da48){return db['Campaign']['find']({'where':{'id':_0x5db407[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x29da48,null))['then'](removeEntity(_0x29da48,null))[_0xdb57('0x51')](handleError(_0x29da48,null));};exports[_0xdb57('0x56')]=function(_0x4a704d,_0x1256c0,_0xa3d3d3){var _0x9b6fd4={'raw':!![],'where':{}};var _0x2ed7cc={};var _0x54411f={'count':0x0,'rows':[]};return db[_0xdb57('0x2e')][_0xdb57('0x57')]({'where':{'id':_0x4a704d[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x1256c0,null))[_0xdb57('0x25')](function(_0x5a6acd){if(_0x5a6acd){_0x2ed7cc['model']=_[_0xdb57('0x33')](db['CmHopper']['rawAttributes']);_0x2ed7cc[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x4a704d['query']);_0x2ed7cc['filters']=_[_0xdb57('0x35')](_0x2ed7cc[_0xdb57('0x32')],_0x2ed7cc[_0xdb57('0x34')]);_0x9b6fd4[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x2ed7cc['model'],qs[_0xdb57('0x37')](_0x4a704d[_0xdb57('0x34')][_0xdb57('0x37')]));_0x9b6fd4[_0xdb57('0x36')]=_0x9b6fd4[_0xdb57('0x36')][_0xdb57('0x38')]?_0x9b6fd4[_0xdb57('0x36')]:_0x2ed7cc['model'];if(!_0x4a704d[_0xdb57('0x34')]['hasOwnProperty']('nolimit')){_0x9b6fd4['limit']=qs[_0xdb57('0x1f')](_0x4a704d[_0xdb57('0x34')]['limit']);_0x9b6fd4[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x4a704d[_0xdb57('0x34')]['offset']);}_0x9b6fd4['order']=qs['sort'](_0x4a704d['query'][_0xdb57('0x3c')]);_0x9b6fd4[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_[_0xdb57('0x58')](_0x4a704d[_0xdb57('0x34')],_0x2ed7cc['filters']));_0x9b6fd4[_0xdb57('0x3d')]['CampaignId']=_0x5a6acd['id'];if(_0x4a704d[_0xdb57('0x34')][_0xdb57('0x41')]){_0x9b6fd4['where']=_['merge'](_0x9b6fd4[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x9b6fd4[_0xdb57('0x36')],function(_0x588446){var _0x18bb07={};_0x18bb07[_0x588446]={'$like':'%'+_0x4a704d[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x18bb07;})});}_0x9b6fd4=_[_0xdb57('0x3f')]({},_0x9b6fd4,_0x4a704d[_0xdb57('0x47')]);return db[_0xdb57('0x59')][_0xdb57('0x1e')]({'where':_0x9b6fd4['where']})[_0xdb57('0x25')](function(_0x18db6d){_0x54411f[_0xdb57('0x1e')]=_0x18db6d;if(_0x4a704d['query'][_0xdb57('0x42')]){_0x9b6fd4[_0xdb57('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x9b6fd4);})[_0xdb57('0x25')](function(_0xfe2999){_0x54411f[_0xdb57('0x5a')]=_0xfe2999;return _0x54411f;});}})['then'](respondWithFilteredResult(_0x1256c0,_0x9b6fd4))[_0xdb57('0x51')](handleError(_0x1256c0,null));};exports[_0xdb57('0x5b')]=function(_0x12f90d,_0x8aa5ea,_0x3ee8b5){var _0x3f803d={'raw':!![],'where':{}};var _0xa04e91={};var _0x56d69f={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x12f90d[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x8aa5ea,null))[_0xdb57('0x25')](function(_0x2430aa){if(_0x2430aa){_0xa04e91[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x5c')][_0xdb57('0x2f')]);_0xa04e91[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x12f90d['query']);_0xa04e91[_0xdb57('0x3e')]=_['intersection'](_0xa04e91[_0xdb57('0x32')],_0xa04e91[_0xdb57('0x34')]);_0x3f803d[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0xa04e91['model'],qs[_0xdb57('0x37')](_0x12f90d['query'][_0xdb57('0x37')]));_0x3f803d[_0xdb57('0x36')]=_0x3f803d[_0xdb57('0x36')]['length']?_0x3f803d[_0xdb57('0x36')]:_0xa04e91[_0xdb57('0x32')];if(!_0x12f90d[_0xdb57('0x34')]['hasOwnProperty'](_0xdb57('0x3a'))){_0x3f803d['limit']=qs[_0xdb57('0x1f')](_0x12f90d[_0xdb57('0x34')]['limit']);_0x3f803d[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x12f90d[_0xdb57('0x34')][_0xdb57('0x1c')]);}_0x3f803d['order']=qs[_0xdb57('0x3c')](_0x12f90d[_0xdb57('0x34')][_0xdb57('0x3c')]);_0x3f803d['where']=qs[_0xdb57('0x3e')](_[_0xdb57('0x58')](_0x12f90d[_0xdb57('0x34')],_0xa04e91[_0xdb57('0x3e')]));_0x3f803d[_0xdb57('0x3d')][_0xdb57('0x5d')]=_0x2430aa['id'];if(_0x12f90d[_0xdb57('0x34')][_0xdb57('0x41')]){_0x3f803d[_0xdb57('0x3d')]=_['merge'](_0x3f803d[_0xdb57('0x3d')],{'$or':_['map'](_0x3f803d[_0xdb57('0x36')],function(_0x3b7c42){var _0x22d5b5={};_0x22d5b5[_0x3b7c42]={'$like':'%'+_0x12f90d[_0xdb57('0x34')]['filter']+'%'};return _0x22d5b5;})});}_0x3f803d=_[_0xdb57('0x3f')]({},_0x3f803d,_0x12f90d['options']);return db[_0xdb57('0x5c')]['count']({'where':_0x3f803d[_0xdb57('0x3d')]})[_0xdb57('0x25')](function(_0x4381a6){_0x56d69f[_0xdb57('0x1e')]=_0x4381a6;if(_0x12f90d[_0xdb57('0x34')][_0xdb57('0x42')]){_0x3f803d['include']=[{'all':!![]}];}return db[_0xdb57('0x5c')][_0xdb57('0x44')](_0x3f803d);})[_0xdb57('0x25')](function(_0x4f775e){_0x56d69f[_0xdb57('0x5a')]=_0x4f775e;return _0x56d69f;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x8aa5ea,_0x3f803d))[_0xdb57('0x51')](handleError(_0x8aa5ea,null));};exports['getHopperFinals']=function(_0xc6113b,_0x18009a,_0x111b78){var _0x4a6ee1={'raw':!![],'where':{}};var _0x2b49cc={};var _0x4534d1={'count':0x0,'rows':[]};return db[_0xdb57('0x2e')][_0xdb57('0x57')]({'where':{'id':_0xc6113b['params']['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x18009a,null))['then'](function(_0x352b35){if(_0x352b35){_0x2b49cc[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x5e')]['rawAttributes']);_0x2b49cc[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0xc6113b[_0xdb57('0x34')]);_0x2b49cc[_0xdb57('0x3e')]=_[_0xdb57('0x35')](_0x2b49cc[_0xdb57('0x32')],_0x2b49cc[_0xdb57('0x34')]);_0x4a6ee1[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x2b49cc[_0xdb57('0x32')],qs['fields'](_0xc6113b[_0xdb57('0x34')][_0xdb57('0x37')]));_0x4a6ee1[_0xdb57('0x36')]=_0x4a6ee1['attributes'][_0xdb57('0x38')]?_0x4a6ee1[_0xdb57('0x36')]:_0x2b49cc[_0xdb57('0x32')];if(!_0xc6113b['query'][_0xdb57('0x39')](_0xdb57('0x3a'))){_0x4a6ee1[_0xdb57('0x1f')]=qs[_0xdb57('0x1f')](_0xc6113b['query'][_0xdb57('0x1f')]);_0x4a6ee1[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0xc6113b[_0xdb57('0x34')][_0xdb57('0x1c')]);}_0x4a6ee1[_0xdb57('0x3b')]=qs[_0xdb57('0x3c')](_0xc6113b[_0xdb57('0x34')][_0xdb57('0x3c')]);_0x4a6ee1[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_['pick'](_0xc6113b[_0xdb57('0x34')],_0x2b49cc['filters']));_0x4a6ee1[_0xdb57('0x3d')]['CampaignId']=_0x352b35['id'];if(_0xc6113b['query'][_0xdb57('0x41')]){_0x4a6ee1[_0xdb57('0x3d')]=_[_0xdb57('0x3f')](_0x4a6ee1[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x4a6ee1[_0xdb57('0x36')],function(_0x34bf2d){var _0x2a6503={};_0x2a6503[_0x34bf2d]={'$like':'%'+_0xc6113b[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x2a6503;})});}_0x4a6ee1=_[_0xdb57('0x3f')]({},_0x4a6ee1,_0xc6113b[_0xdb57('0x47')]);return db[_0xdb57('0x5e')]['count']({'where':_0x4a6ee1['where']})[_0xdb57('0x25')](function(_0x132ebf){_0x4534d1[_0xdb57('0x1e')]=_0x132ebf;if(_0xc6113b[_0xdb57('0x34')][_0xdb57('0x42')]){_0x4a6ee1['include']=[{'all':!![]}];}return db[_0xdb57('0x5e')][_0xdb57('0x44')](_0x4a6ee1);})[_0xdb57('0x25')](function(_0x3b6235){_0x4534d1['rows']=_0x3b6235;return _0x4534d1;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x18009a,_0x4a6ee1))[_0xdb57('0x51')](handleError(_0x18009a,null));};exports[_0xdb57('0x5f')]=function(_0x421427,_0x7e346b,_0x101ee5){var _0x29696e={'raw':!![],'where':{}};var _0x44f717={};var _0x55a690={'count':0x0,'rows':[]};return db['Campaign'][_0xdb57('0x57')]({'where':{'id':_0x421427[_0xdb57('0x46')]['id']}})['then'](handleEntityNotFound(_0x7e346b,null))[_0xdb57('0x25')](function(_0x195ccc){if(_0x195ccc){_0x44f717[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x60')]['rawAttributes']);_0x44f717[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x421427[_0xdb57('0x34')]);_0x44f717['filters']=_[_0xdb57('0x35')](_0x44f717['model'],_0x44f717[_0xdb57('0x34')]);_0x29696e[_0xdb57('0x36')]=_['intersection'](_0x44f717[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x421427[_0xdb57('0x34')][_0xdb57('0x37')]));_0x29696e[_0xdb57('0x36')]=_0x29696e[_0xdb57('0x36')][_0xdb57('0x38')]?_0x29696e[_0xdb57('0x36')]:_0x44f717['model'];if(!_0x421427[_0xdb57('0x34')][_0xdb57('0x39')](_0xdb57('0x3a'))){_0x29696e['limit']=qs[_0xdb57('0x1f')](_0x421427[_0xdb57('0x34')][_0xdb57('0x1f')]);_0x29696e[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x421427[_0xdb57('0x34')][_0xdb57('0x1c')]);}_0x29696e['order']=qs[_0xdb57('0x3c')](_0x421427[_0xdb57('0x34')]['sort']);_0x29696e[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_[_0xdb57('0x58')](_0x421427[_0xdb57('0x34')],_0x44f717[_0xdb57('0x3e')]));_0x29696e[_0xdb57('0x3d')]['CampaignId']=_0x195ccc['id'];if(_0x421427[_0xdb57('0x34')][_0xdb57('0x41')]){_0x29696e[_0xdb57('0x3d')]=_[_0xdb57('0x3f')](_0x29696e[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x29696e['attributes'],function(_0x3d0609){var _0x20423c={};_0x20423c[_0x3d0609]={'$like':'%'+_0x421427[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x20423c;})});}_0x29696e=_['merge']({},_0x29696e,_0x421427[_0xdb57('0x47')]);return db[_0xdb57('0x60')]['count']({'where':_0x29696e[_0xdb57('0x3d')]})[_0xdb57('0x25')](function(_0x5c420b){_0x55a690[_0xdb57('0x1e')]=_0x5c420b;if(_0x421427[_0xdb57('0x34')]['includeAll']){_0x29696e['include']=[{'all':!![]}];}return db[_0xdb57('0x60')]['findAll'](_0x29696e);})[_0xdb57('0x25')](function(_0x16e446){_0x55a690[_0xdb57('0x5a')]=_0x16e446;return _0x55a690;});}})[_0xdb57('0x25')](respondWithFilteredResult(_0x7e346b,_0x29696e))[_0xdb57('0x51')](handleError(_0x7e346b,null));};exports[_0xdb57('0x61')]=function(_0x39de79,_0x42c2a8,_0x425f50){var _0x182af6={};var _0x7b47c5={};var _0x4a08ad;var _0x23412f;return db[_0xdb57('0x2e')][_0xdb57('0x57')]({'where':{'id':_0x39de79[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x42c2a8,null))[_0xdb57('0x25')](function(_0x5f2655){if(_0x5f2655){_0x4a08ad=_0x5f2655;_0x7b47c5['model']=_[_0xdb57('0x33')](db[_0xdb57('0x62')]['rawAttributes']);_0x7b47c5[_0xdb57('0x34')]=_[_0xdb57('0x33')](_0x39de79[_0xdb57('0x34')]);_0x7b47c5[_0xdb57('0x3e')]=_[_0xdb57('0x35')](_0x7b47c5[_0xdb57('0x32')],_0x7b47c5['query']);_0x182af6[_0xdb57('0x36')]=_[_0xdb57('0x35')](_0x7b47c5[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x39de79[_0xdb57('0x34')][_0xdb57('0x37')]));_0x182af6[_0xdb57('0x36')]=_0x182af6['attributes'][_0xdb57('0x38')]?_0x182af6[_0xdb57('0x36')]:_0x7b47c5[_0xdb57('0x32')];_0x182af6[_0xdb57('0x3b')]=qs[_0xdb57('0x3c')](_0x39de79['query'][_0xdb57('0x3c')]);_0x182af6[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_[_0xdb57('0x58')](_0x39de79['query'],_0x7b47c5['filters']));if(_0x39de79['query'][_0xdb57('0x41')]){_0x182af6['where']=_[_0xdb57('0x3f')](_0x182af6[_0xdb57('0x3d')],{'$or':_[_0xdb57('0x2d')](_0x182af6['attributes'],function(_0x57c22e){var _0x253030={};_0x253030[_0x57c22e]={'$like':'%'+_0x39de79[_0xdb57('0x34')]['filter']+'%'};return _0x253030;})});}_0x182af6=_[_0xdb57('0x3f')]({},_0x182af6,_0x39de79[_0xdb57('0x47')]);return _0x4a08ad['getLists'](_0x182af6);}})[_0xdb57('0x25')](function(_0x491b1b){if(_0x491b1b){_0x23412f=_0x491b1b[_0xdb57('0x38')];if(!_0x39de79[_0xdb57('0x34')]['hasOwnProperty'](_0xdb57('0x3a'))){_0x182af6['limit']=qs[_0xdb57('0x1f')](_0x39de79['query']['limit']);_0x182af6[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x39de79[_0xdb57('0x34')]['offset']);}return _0x4a08ad[_0xdb57('0x61')](_0x182af6);}})[_0xdb57('0x25')](function(_0x340816){if(_0x340816){return _0x340816?{'count':_0x23412f,'rows':_0x340816}:null;}})[_0xdb57('0x25')](respondWithResult(_0x42c2a8,null))['catch'](handleError(_0x42c2a8,null));};exports[_0xdb57('0x63')]=function(_0xd5ccc1,_0x21a30f,_0x2788fc){var _0x4f04c0,_0x2c6762;var _0x104ca7=[];var _0x34e895=moment()['format'](_0xdb57('0x64'));return db[_0xdb57('0x2e')][_0xdb57('0x48')]({'where':{'id':_0xd5ccc1[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x21a30f,null))['then'](function(_0x50d4ad){if(_0x50d4ad){_0x2c6762=_0x50d4ad;return _0x50d4ad[_0xdb57('0x63')](_0xd5ccc1[_0xdb57('0x4a')][_0xdb57('0x65')],_['omit'](_0xd5ccc1[_0xdb57('0x4a')],[_0xdb57('0x65'),'id'])||{});}return null;})[_0xdb57('0x66')](function(_0x856af6){var _0x49dc5d;var _0x9f4eb0;_0x4f04c0=_0x856af6||[];var _0x246468=[];if(_0x856af6){for(var _0x12df8d=0x0;_0x12df8d<_0x856af6['length'];_0x12df8d+=0x1){var _0x55f617=_0x856af6[_0x12df8d][_0xdb57('0x4c')]({'plain':!![]});_0x2c6762['dialCheckDuplicateType']=_0xd5ccc1[_0xdb57('0x4a')][_0xdb57('0x67')]?_0xd5ccc1['body']['dialCheckDuplicateType']:_0x2c6762[_0xdb57('0x67')];switch(_0x2c6762['dialCheckDuplicateType']){case _0xdb57('0x68'):_0x49dc5d=squel[_0xdb57('0x69')]()[_0xdb57('0x6a')]('cm_hopper')[_0xdb57('0x6b')](['phone',_0xdb57('0x6c'),_0xdb57('0x6d'),_0xdb57('0x6e'),_0xdb57('0x5d'),_0xdb57('0x54'),'updatedAt'],squel['select']()['field'](_0xdb57('0x6f'),_0xdb57('0x6f'))[_0xdb57('0x70')](_0xdb57('0x71'),_0xdb57('0x6c'))['field']('id',_0xdb57('0x6d'))[_0xdb57('0x70')](_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')](),_0xdb57('0x6e'))['field'](_0xd5ccc1[_0xdb57('0x46')]['id'][_0xdb57('0x73')](),_0xdb57('0x5d'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x54'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x55'))[_0xdb57('0x74')](_0xdb57('0x75'))['where'](_0xdb57('0x76'))['where'](_0xdb57('0x77'),_0x55f617['CmListId'][_0xdb57('0x73')]())[_0xdb57('0x3d')](_0xdb57('0x78'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xdb57('0x79')]()[_0xdb57('0x70')](_0xdb57('0x7a'))[_0xdb57('0x74')]('cm_hopper_final')[_0xdb57('0x3d')](_0xdb57('0x7b'),_0xd5ccc1['params']['id']['toString']()))[_0xdb57('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdb57('0x79')]()[_0xdb57('0x70')](_0xdb57('0x7c'))[_0xdb57('0x74')](_0xdb57('0x7d'))[_0xdb57('0x3d')](_0xdb57('0x7b'),_0xd5ccc1[_0xdb57('0x46')]['id']['toString']())))[_0xdb57('0x73')]();break;case'onlyIfOpen':_0x49dc5d=squel[_0xdb57('0x69')]()[_0xdb57('0x6a')](_0xdb57('0x7d'))[_0xdb57('0x6b')](['phone','scheduledAt',_0xdb57('0x6d'),_0xdb57('0x6e'),_0xdb57('0x5d'),_0xdb57('0x54'),_0xdb57('0x55')],squel['select']()[_0xdb57('0x70')](_0xdb57('0x6f'),_0xdb57('0x6f'))[_0xdb57('0x70')](_0xdb57('0x71'),_0xdb57('0x6c'))['field']('id',_0xdb57('0x6d'))[_0xdb57('0x70')](_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')](),_0xdb57('0x6e'))[_0xdb57('0x70')](_0xd5ccc1['params']['id'][_0xdb57('0x73')](),_0xdb57('0x5d'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x54'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x55'))[_0xdb57('0x74')](_0xdb57('0x75'))[_0xdb57('0x3d')](_0xdb57('0x76'))[_0xdb57('0x3d')](_0xdb57('0x77'),_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')]())[_0xdb57('0x3d')](_0xdb57('0x78'))[_0xdb57('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdb57('0x70')](_0xdb57('0x7c'))[_0xdb57('0x74')](_0xdb57('0x7d'))['where'](_0xdb57('0x7b'),_0xd5ccc1[_0xdb57('0x46')]['id'][_0xdb57('0x73')]())))[_0xdb57('0x73')]();break;default:_0x49dc5d=squel[_0xdb57('0x69')]()['into']('cm_hopper')['fromQuery']([_0xdb57('0x6f'),_0xdb57('0x6c'),_0xdb57('0x6d'),'ListId',_0xdb57('0x5d'),_0xdb57('0x54'),_0xdb57('0x55')],squel[_0xdb57('0x79')]()[_0xdb57('0x70')]('phone',_0xdb57('0x6f'))[_0xdb57('0x70')](_0xdb57('0x71'),'scheduledAt')[_0xdb57('0x70')]('id','ContactId')[_0xdb57('0x70')](_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')](),_0xdb57('0x6e'))[_0xdb57('0x70')](_0xd5ccc1[_0xdb57('0x46')]['id'][_0xdb57('0x73')](),_0xdb57('0x5d'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x54'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x55'))[_0xdb57('0x74')](_0xdb57('0x75'))[_0xdb57('0x3d')](_0xdb57('0x76'))['where'](_0xdb57('0x77'),_0x55f617[_0xdb57('0x72')][_0xdb57('0x73')]())[_0xdb57('0x3d')](_0xdb57('0x78')))[_0xdb57('0x73')]();}_0x9f4eb0=squel[_0xdb57('0x69')]()['into'](_0xdb57('0x7e'))[_0xdb57('0x6b')]([_0xdb57('0x7f'),_0xdb57('0x6c'),_0xdb57('0x6f'),_0xdb57('0x80'),_0xdb57('0x54'),'updatedAt'],squel[_0xdb57('0x79')]()[_0xdb57('0x70')](_0xdb57('0x81'),'id')['field'](_0xdb57('0x71'),_0xdb57('0x6c'))['field'](_0xdb57('0x82'),_0xdb57('0x6f'))[_0xdb57('0x70')](_0xdb57('0x83'),_0xdb57('0x80'))['field']('\x27'+_0x34e895+'\x27',_0xdb57('0x54'))[_0xdb57('0x70')]('\x27'+_0x34e895+'\x27',_0xdb57('0x55'))[_0xdb57('0x74')](_0xdb57('0x84'),'ci')[_0xdb57('0x85')]('cm_hopper','h',_0xdb57('0x86'))[_0xdb57('0x3d')](_0xdb57('0x87'),_0x55f617['CmListId'][_0xdb57('0x73')]())[_0xdb57('0x3d')](_0xdb57('0x88'),_0xd5ccc1[_0xdb57('0x46')]['id'][_0xdb57('0x73')]())['where'](_0xdb57('0x89'),_0x34e895))['toString']();_0x246468[_0xdb57('0x8a')](db[_0xdb57('0x8b')]['query'](_0x49dc5d));_0x104ca7[_0xdb57('0x8a')](db['sequelize'][_0xdb57('0x34')](_0x9f4eb0));}return BPromise[_0xdb57('0x8c')](_0x246468);}})['then'](function(){return BPromise[_0xdb57('0x8c')](_0x104ca7);})[_0xdb57('0x25')](function(){return _0x4f04c0;})[_0xdb57('0x25')](respondWithResult(_0x21a30f,null))[_0xdb57('0x51')](handleError(_0x21a30f,null));};exports['removeLists']=function(_0x479ea7,_0x3c0ec1,_0xe5a4be){return db[_0xdb57('0x2e')][_0xdb57('0x48')]({'where':{'id':_0x479ea7[_0xdb57('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c0ec1,null))['then'](function(_0xac1323){if(_0xac1323){return _0xac1323[_0xdb57('0x8d')](_0x479ea7[_0xdb57('0x34')][_0xdb57('0x65')]);}})['then'](function(_0x434563){if(_0x434563){return db['CmHopper'][_0xdb57('0x26')]({'where':{'ListId':_0x479ea7[_0xdb57('0x34')][_0xdb57('0x65')],'CampaignId':_0x479ea7[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](function(){return _0x434563;});}})[_0xdb57('0x25')](respondWithStatusCode(_0x3c0ec1,null))[_0xdb57('0x51')](handleError(_0x3c0ec1,null));};exports[_0xdb57('0x8e')]=function(_0x70266f,_0x26b5c9,_0x1b6bf0){var _0x3bb8eb={};var _0x27a4ca={};var _0x4ed971;var _0x3e78cd;return db[_0xdb57('0x2e')][_0xdb57('0x57')]({'where':{'id':_0x70266f[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0x26b5c9,null))[_0xdb57('0x25')](function(_0x16d08c){if(_0x16d08c){_0x4ed971=_0x16d08c;_0x27a4ca[_0xdb57('0x32')]=_[_0xdb57('0x33')](db[_0xdb57('0x62')]['rawAttributes']);_0x27a4ca[_0xdb57('0x34')]=_['keys'](_0x70266f[_0xdb57('0x34')]);_0x27a4ca[_0xdb57('0x3e')]=_[_0xdb57('0x35')](_0x27a4ca[_0xdb57('0x32')],_0x27a4ca[_0xdb57('0x34')]);_0x3bb8eb[_0xdb57('0x36')]=_['intersection'](_0x27a4ca[_0xdb57('0x32')],qs[_0xdb57('0x37')](_0x70266f[_0xdb57('0x34')][_0xdb57('0x37')]));_0x3bb8eb[_0xdb57('0x36')]=_0x3bb8eb[_0xdb57('0x36')][_0xdb57('0x38')]?_0x3bb8eb[_0xdb57('0x36')]:_0x27a4ca[_0xdb57('0x32')];_0x3bb8eb[_0xdb57('0x3b')]=qs[_0xdb57('0x3c')](_0x70266f[_0xdb57('0x34')][_0xdb57('0x3c')]);_0x3bb8eb[_0xdb57('0x3d')]=qs[_0xdb57('0x3e')](_['pick'](_0x70266f[_0xdb57('0x34')],_0x27a4ca[_0xdb57('0x3e')]));if(_0x70266f[_0xdb57('0x34')]['filter']){_0x3bb8eb[_0xdb57('0x3d')]=_[_0xdb57('0x3f')](_0x3bb8eb['where'],{'$or':_[_0xdb57('0x2d')](_0x3bb8eb[_0xdb57('0x36')],function(_0x4b0a39){var _0x562018={};_0x562018[_0x4b0a39]={'$like':'%'+_0x70266f[_0xdb57('0x34')][_0xdb57('0x41')]+'%'};return _0x562018;})});}_0x3bb8eb=_[_0xdb57('0x3f')]({},_0x3bb8eb,_0x70266f[_0xdb57('0x47')]);return _0x4ed971['getBlackLists'](_0x3bb8eb);}})[_0xdb57('0x25')](function(_0x4e4dd5){if(_0x4e4dd5){_0x3e78cd=_0x4e4dd5[_0xdb57('0x38')];if(!_0x70266f[_0xdb57('0x34')]['hasOwnProperty']('nolimit')){_0x3bb8eb[_0xdb57('0x1f')]=qs[_0xdb57('0x1f')](_0x70266f[_0xdb57('0x34')][_0xdb57('0x1f')]);_0x3bb8eb[_0xdb57('0x1c')]=qs[_0xdb57('0x1c')](_0x70266f['query'][_0xdb57('0x1c')]);}return _0x4ed971['getBlackLists'](_0x3bb8eb);}})[_0xdb57('0x25')](function(_0x5e295f){if(_0x5e295f){return _0x5e295f?{'count':_0x3e78cd,'rows':_0x5e295f}:null;}})[_0xdb57('0x25')](respondWithResult(_0x26b5c9,null))[_0xdb57('0x51')](handleError(_0x26b5c9,null));};exports[_0xdb57('0x8f')]=function(_0xa4d460,_0x3dc5cc,_0x41b295){var _0x4ef27d,_0x5165c2;var _0x2b3fcf=[];var _0x3e6eaa=moment()[_0xdb57('0x90')](_0xdb57('0x64'));return db['Campaign'][_0xdb57('0x48')]({'where':{'id':_0xa4d460[_0xdb57('0x46')]['id']}})['then'](handleEntityNotFound(_0x3dc5cc,null))[_0xdb57('0x25')](function(_0x155a24){if(_0x155a24){_0x5165c2=_0x155a24;return _0x155a24[_0xdb57('0x8f')](_0xa4d460[_0xdb57('0x4a')]['ids'],_[_0xdb57('0x53')](_0xa4d460[_0xdb57('0x4a')],[_0xdb57('0x65'),'id'])||{});}return null;})['spread'](function(_0x42a946){var _0x477eb3;var _0x1b8e0b;_0x4ef27d=_0x42a946||[];var _0x411c40=[];if(_0x42a946){for(var _0x2e77f2=0x0;_0x2e77f2<_0x42a946[_0xdb57('0x38')];_0x2e77f2+=0x1){var _0x44ccde=_0x42a946[_0x2e77f2][_0xdb57('0x4c')]({'plain':!![]});_0x477eb3=squel[_0xdb57('0x69')]()[_0xdb57('0x6a')](_0xdb57('0x91'))[_0xdb57('0x6b')](['phone',_0xdb57('0x6d'),_0xdb57('0x6e'),'CampaignId',_0xdb57('0x54'),'updatedAt'],squel[_0xdb57('0x79')]()[_0xdb57('0x70')](_0xdb57('0x6f'),_0xdb57('0x6f'))['field']('id','ContactId')[_0xdb57('0x70')](_0x44ccde[_0xdb57('0x72')][_0xdb57('0x73')](),_0xdb57('0x6e'))[_0xdb57('0x70')](_0xa4d460[_0xdb57('0x46')]['id'][_0xdb57('0x73')](),_0xdb57('0x5d'))[_0xdb57('0x70')](_0xdb57('0x71'),_0xdb57('0x54'))['field'](_0xdb57('0x71'),_0xdb57('0x55'))[_0xdb57('0x74')]('cm_contacts')[_0xdb57('0x3d')](_0xdb57('0x76'))[_0xdb57('0x3d')](_0xdb57('0x77'),_0x44ccde['CmListId']['toString']())[_0xdb57('0x3d')](_0xdb57('0x78')))[_0xdb57('0x73')]();_0x411c40[_0xdb57('0x8a')](db[_0xdb57('0x8b')][_0xdb57('0x34')](_0x477eb3));}return BPromise[_0xdb57('0x8c')](_0x411c40);}})[_0xdb57('0x25')](function(){return _0x4ef27d;})[_0xdb57('0x25')](respondWithResult(_0x3dc5cc,null))['catch'](handleError(_0x3dc5cc,null));};exports['removeBlackLists']=function(_0x5f0d8c,_0xb81699,_0x1e5bf4){return db[_0xdb57('0x2e')]['find']({'where':{'id':_0x5f0d8c[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](handleEntityNotFound(_0xb81699,null))[_0xdb57('0x25')](function(_0x4d3126){if(_0x4d3126){return _0x4d3126[_0xdb57('0x92')](_0x5f0d8c[_0xdb57('0x34')]['ids']);}})[_0xdb57('0x25')](function(_0xf3b9d3){if(_0xf3b9d3){return db[_0xdb57('0x60')]['destroy']({'where':{'ListId':_0x5f0d8c['query'][_0xdb57('0x65')],'CampaignId':_0x5f0d8c[_0xdb57('0x46')]['id']}})[_0xdb57('0x25')](function(){return _0xf3b9d3;});}})[_0xdb57('0x25')](respondWithStatusCode(_0xb81699,null))['catch'](handleError(_0xb81699,null));};
\ No newline at end of file
+var _0xc48e=['rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','createdAt','getHoppers','CmHopper','pick','findOne','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','updatedAt','select','NOW()','field','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','format','addBlackLists','spread','removeBlackLists','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','Campaign','findAll','rows','show','params'];(function(_0x156e7b,_0x757e18){var _0x59ce42=function(_0x339b08){while(--_0x339b08){_0x156e7b['push'](_0x156e7b['shift']());}};_0x59ce42(++_0x757e18);}(_0xc48e,0xd7));var _0xec48=function(_0x381f0b,_0x2ad002){_0x381f0b=_0x381f0b-0x0;var _0x5e00e9=_0xc48e[_0x381f0b];return _0x5e00e9;};'use strict';var emlformat=require(_0xec48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec48('0x2'));var moment=require(_0xec48('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec48('0x4'));var path=require(_0xec48('0x5'));var sox=require(_0xec48('0x6'));var csv=require(_0xec48('0x7'));var ejs=require(_0xec48('0x8'));var fs=require('fs');var fs_extra=require(_0xec48('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec48('0xa'));var jsforce=require(_0xec48('0xb'));var deskjs=require(_0xec48('0xc'));var toCsv=require(_0xec48('0x7'));var querystring=require(_0xec48('0xd'));var Papa=require(_0xec48('0xe'));var Redis=require(_0xec48('0xf'));var authService=require(_0xec48('0x10'));var qs=require(_0xec48('0x11'));var as=require(_0xec48('0x12'));var hardwareService=require(_0xec48('0x13'));var logger=require('../../config/logger')(_0xec48('0x14'));var utils=require(_0xec48('0x15'));var config=require(_0xec48('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xec48('0x17'))['db'];function respondWithStatusCode(_0x4a4761,_0x4f17d7){_0x4f17d7=_0x4f17d7||0xcc;return function(_0x2fe7f1){if(_0x2fe7f1){return _0x4a4761[_0xec48('0x18')](_0x4f17d7);}return _0x4a4761[_0xec48('0x19')](_0x4f17d7)[_0xec48('0x1a')]();};}function respondWithResult(_0x3677a3,_0x3374c4){_0x3374c4=_0x3374c4||0xc8;return function(_0x5ef355){if(_0x5ef355){return _0x3677a3[_0xec48('0x19')](_0x3374c4)[_0xec48('0x1b')](_0x5ef355);}};}function respondWithFilteredResult(_0x42202a,_0xf77d40){return function(_0x4a9150){if(_0x4a9150){var _0x2ef68f=typeof _0xf77d40['offset']==='undefined'&&typeof _0xf77d40[_0xec48('0x1c')]===_0xec48('0x1d');var _0x3a9205=_0x4a9150[_0xec48('0x1e')];var _0x41a7e9=_0x2ef68f?0x0:_0xf77d40[_0xec48('0x1f')];var _0x211f24=_0x2ef68f?_0x4a9150['count']:_0xf77d40[_0xec48('0x1f')]+_0xf77d40['limit'];var _0x40f10e;if(_0x211f24>=_0x3a9205){_0x211f24=_0x3a9205;_0x40f10e=0xc8;}else{_0x40f10e=0xce;}_0x42202a[_0xec48('0x19')](_0x40f10e);return _0x42202a['set'](_0xec48('0x20'),_0x41a7e9+'-'+_0x211f24+'/'+_0x3a9205)[_0xec48('0x1b')](_0x4a9150);}return null;};}function patchUpdates(_0x5e7cb6){return function(_0x50ac10){try{jsonpatch['apply'](_0x50ac10,_0x5e7cb6,!![]);}catch(_0x5575c7){return BPromise[_0xec48('0x21')](_0x5575c7);}return _0x50ac10[_0xec48('0x22')]();};}function saveUpdates(_0x5840d6,_0x98a3b0){return function(_0x5ce57d){if(_0x5ce57d){return _0x5ce57d[_0xec48('0x23')](_0x5840d6)['then'](function(_0x54b55d){return _0x54b55d;});}return null;};}function removeEntity(_0x2a6613,_0x140978){return function(_0x5aeea1){if(_0x5aeea1){return _0x5aeea1[_0xec48('0x24')]()[_0xec48('0x25')](function(){var _0x1d389a=_0x5aeea1[_0xec48('0x26')]({'plain':!![]});var _0x3a6b56='IvrCampaigns';return db[_0xec48('0x27')][_0xec48('0x24')]({'where':{'type':_0x3a6b56,'resourceId':_0x1d389a['id']}})['then'](function(){return _0x5aeea1;});})[_0xec48('0x25')](function(){_0x2a6613['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2270,_0x348293){return function(_0x32f12f){if(!_0x32f12f){_0x5c2270[_0xec48('0x18')](0x194);}return _0x32f12f;};}function handleError(_0x29ce4d,_0x5ea784){_0x5ea784=_0x5ea784||0x1f4;return function(_0x2426ed){logger[_0xec48('0x28')](_0x2426ed[_0xec48('0x29')]);if(_0x2426ed[_0xec48('0x2a')]){delete _0x2426ed[_0xec48('0x2a')];}_0x29ce4d['status'](_0x5ea784)['send'](_0x2426ed);};}exports['index']=function(_0x4eb580,_0x210abe){var _0x3f287f={},_0x34e423={},_0xaf5708={'count':0x0,'rows':[]};var _0x4ef91a=_['map'](db['Campaign']['rawAttributes'],function(_0x393d47){return{'name':_0x393d47['fieldName'],'type':_0x393d47[_0xec48('0x2b')][_0xec48('0x2c')]};});_0x34e423[_0xec48('0x2d')]=_[_0xec48('0x2e')](_0x4ef91a,_0xec48('0x2a'));_0x34e423[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x4eb580[_0xec48('0x2f')]);_0x34e423[_0xec48('0x31')]=_[_0xec48('0x32')](_0x34e423[_0xec48('0x2d')],_0x34e423['query']);_0x3f287f[_0xec48('0x33')]=_[_0xec48('0x32')](_0x34e423['model'],qs['fields'](_0x4eb580[_0xec48('0x2f')][_0xec48('0x34')]));_0x3f287f[_0xec48('0x33')]=_0x3f287f[_0xec48('0x33')][_0xec48('0x35')]?_0x3f287f['attributes']:_0x34e423[_0xec48('0x2d')];if(!_0x4eb580[_0xec48('0x2f')][_0xec48('0x36')](_0xec48('0x37'))){_0x3f287f[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x4eb580['query']['limit']);_0x3f287f[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x4eb580[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x3f287f[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x4eb580[_0xec48('0x2f')][_0xec48('0x39')]);_0x3f287f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_['pick'](_0x4eb580[_0xec48('0x2f')],_0x34e423[_0xec48('0x31')]),_0x4ef91a);if(_0x4eb580[_0xec48('0x2f')]['filter']){_0x3f287f[_0xec48('0x3a')]=_['merge'](_0x3f287f['where'],{'$or':_[_0xec48('0x2e')](_0x4ef91a,function(_0x9ebfd8){if(_0x9ebfd8['type']!==_0xec48('0x3b')){var _0x2f5bac={};_0x2f5bac[_0x9ebfd8['name']]={'$like':'%'+_0x4eb580[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x2f5bac;}})});}_0x3f287f=_[_0xec48('0x3d')]({},_0x3f287f,_0x4eb580[_0xec48('0x3e')]);var _0xa436af={'where':_0x3f287f[_0xec48('0x3a')]};return db['Campaign'][_0xec48('0x1e')](_0xa436af)[_0xec48('0x25')](function(_0x253d1a){_0xaf5708[_0xec48('0x1e')]=_0x253d1a;if(_0x4eb580[_0xec48('0x2f')]['includeAll']){_0x3f287f[_0xec48('0x3f')]=[{'all':!![]}];}return db[_0xec48('0x40')][_0xec48('0x41')](_0x3f287f);})['then'](function(_0x57008c){_0xaf5708[_0xec48('0x42')]=_0x57008c;return _0xaf5708;})[_0xec48('0x25')](respondWithFilteredResult(_0x210abe,_0x3f287f))['catch'](handleError(_0x210abe,null));};exports[_0xec48('0x43')]=function(_0x58b45f,_0x3f0ea1){var _0x4a8dfc={'raw':![],'where':{'id':_0x58b45f[_0xec48('0x44')]['id']}},_0xf6957={};_0xf6957[_0xec48('0x2d')]=_[_0xec48('0x30')](db['Campaign'][_0xec48('0x45')]);_0xf6957[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x58b45f[_0xec48('0x2f')]);_0xf6957[_0xec48('0x31')]=_[_0xec48('0x32')](_0xf6957[_0xec48('0x2d')],_0xf6957[_0xec48('0x2f')]);_0x4a8dfc[_0xec48('0x33')]=_[_0xec48('0x32')](_0xf6957[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x58b45f['query'][_0xec48('0x34')]));_0x4a8dfc[_0xec48('0x33')]=_0x4a8dfc[_0xec48('0x33')][_0xec48('0x35')]?_0x4a8dfc[_0xec48('0x33')]:_0xf6957['model'];if(_0x58b45f[_0xec48('0x2f')][_0xec48('0x46')]){_0x4a8dfc['include']=[{'all':!![]}];}_0x4a8dfc=_[_0xec48('0x3d')]({},_0x4a8dfc,_0x58b45f[_0xec48('0x3e')]);return db[_0xec48('0x40')][_0xec48('0x47')](_0x4a8dfc)[_0xec48('0x25')](handleEntityNotFound(_0x3f0ea1,null))[_0xec48('0x25')](respondWithResult(_0x3f0ea1,null))['catch'](handleError(_0x3f0ea1,null));};exports['create']=function(_0x1313fb,_0x5e88cb){return db[_0xec48('0x40')][_0xec48('0x48')](_0x1313fb[_0xec48('0x49')],{})['then'](function(_0x3c468d){var _0x44da3e=_0x1313fb[_0xec48('0x4a')][_0xec48('0x26')]({'plain':!![]});if(!_0x44da3e)throw new Error(_0xec48('0x4b'));if(_0x44da3e[_0xec48('0x4c')]===_0xec48('0x4a')){var _0x378288=_0x3c468d[_0xec48('0x26')]({'plain':!![]});var _0x1999c0=_0xec48('0x4d');return db['UserProfileSection'][_0xec48('0x47')]({'where':{'name':_0x1999c0,'userProfileId':_0x44da3e[_0xec48('0x4e')]},'raw':!![]})[_0xec48('0x25')](function(_0xffbfa1){if(_0xffbfa1&&_0xffbfa1[_0xec48('0x4f')]===0x0){return db[_0xec48('0x27')][_0xec48('0x48')]({'name':_0x378288[_0xec48('0x2a')],'resourceId':_0x378288['id'],'type':_0xffbfa1['name'],'sectionId':_0xffbfa1['id']},{})[_0xec48('0x25')](function(){return _0x3c468d;});}else{return _0x3c468d;}})['catch'](function(_0x172f57){logger['error'](_0xec48('0x50'),_0x172f57);throw _0x172f57;});}return _0x3c468d;})['then'](respondWithResult(_0x5e88cb,0xc9))[_0xec48('0x51')](handleError(_0x5e88cb,null));};exports[_0xec48('0x52')]=function(_0x496226,_0x28dd61){var _0x63629={'where':{'id':_0x496226[_0xec48('0x44')]['id']}},_0x578647={};_0x578647[_0xec48('0x2d')]=_[_0xec48('0x30')](db['Campaign'][_0xec48('0x45')]);_0x63629['attributes']=_[_0xec48('0x32')](_0x578647['model'],qs['fields'](_0x496226[_0xec48('0x2f')][_0xec48('0x34')]));_0x63629[_0xec48('0x33')]=_0x63629[_0xec48('0x33')][_0xec48('0x35')]?_0x63629['attributes']:_0x578647[_0xec48('0x2d')];if(_0x496226[_0xec48('0x2f')][_0xec48('0x46')]){_0x63629[_0xec48('0x3f')]=[{'all':!![]}];}_0x63629=_[_0xec48('0x3d')]({},_0x63629,_0x496226[_0xec48('0x3e')]);return db['Campaign'][_0xec48('0x47')](_0x63629)[_0xec48('0x25')](handleEntityNotFound(_0x28dd61,null))[_0xec48('0x25')](function(_0x214b3b){if(_0x214b3b){var _0x2ae6a1=_0x214b3b[_0xec48('0x26')]({'plain':!![]});_0x2ae6a1=qs[_0xec48('0x53')](_0x2ae6a1,['id',_0xec48('0x54'),'updatedAt']);_0x496226[_0xec48('0x49')]=_[_0xec48('0x53')](_0x496226[_0xec48('0x49')],['id',_0xec48('0x54'),'updatedAt']);return db['Campaign'][_0xec48('0x48')](_['merge'](_0x2ae6a1,_0x496226[_0xec48('0x49')]),{'include':_0x496226[_0xec48('0x2f')][_0xec48('0x46')]?[{'all':!![]}]:undefined})[_0xec48('0x25')](function(_0x4e3899){var _0x387421=_0x496226['user'][_0xec48('0x26')]({'plain':!![]});if(!_0x387421)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x387421[_0xec48('0x4c')]==='user'){var _0x167a04=_0x4e3899[_0xec48('0x26')]({'plain':!![]});var _0x4e6507=_0xec48('0x4d');return db['UserProfileSection'][_0xec48('0x47')]({'where':{'name':_0x4e6507,'userProfileId':_0x387421[_0xec48('0x4e')]},'raw':!![]})[_0xec48('0x25')](function(_0x594388){if(_0x594388&&_0x594388['autoAssociation']===0x0){return db[_0xec48('0x27')][_0xec48('0x48')]({'name':_0x167a04[_0xec48('0x2a')],'resourceId':_0x167a04['id'],'type':_0x594388[_0xec48('0x2a')],'sectionId':_0x594388['id']},{})[_0xec48('0x25')](function(){return _0x4e3899;});}else{return _0x4e3899;}})[_0xec48('0x51')](function(_0x3fa36d){logger['error'](_0xec48('0x50'),_0x3fa36d);throw _0x3fa36d;});}return _0x4e3899;});}})['then'](respondWithResult(_0x28dd61,0xc9))[_0xec48('0x51')](handleError(_0x28dd61,null));};exports[_0xec48('0x23')]=function(_0x460172,_0x114ba3){if(_0x460172[_0xec48('0x49')]['id']){delete _0x460172[_0xec48('0x49')]['id'];}return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x460172[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x114ba3,null))[_0xec48('0x25')](saveUpdates(_0x460172[_0xec48('0x49')],null))[_0xec48('0x25')](respondWithResult(_0x114ba3,null))['catch'](handleError(_0x114ba3,null));};exports['destroy']=function(_0x2b3d30,_0xd3c82b){return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x2b3d30[_0xec48('0x44')]['id']}})[_0xec48('0x25')](handleEntityNotFound(_0xd3c82b,null))['then'](removeEntity(_0xd3c82b,null))['catch'](handleError(_0xd3c82b,null));};exports[_0xec48('0x55')]=function(_0x45371f,_0xfcb3df,_0x4d0c8d){var _0x4eb807={'raw':!![],'where':{}};var _0x5b33ef={};var _0x4a3974={'count':0x0,'rows':[]};return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x45371f[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0xfcb3df,null))[_0xec48('0x25')](function(_0x29e012){if(_0x29e012){_0x5b33ef[_0xec48('0x2d')]=_[_0xec48('0x30')](db[_0xec48('0x56')]['rawAttributes']);_0x5b33ef[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x45371f[_0xec48('0x2f')]);_0x5b33ef[_0xec48('0x31')]=_[_0xec48('0x32')](_0x5b33ef[_0xec48('0x2d')],_0x5b33ef[_0xec48('0x2f')]);_0x4eb807[_0xec48('0x33')]=_['intersection'](_0x5b33ef[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x45371f[_0xec48('0x2f')][_0xec48('0x34')]));_0x4eb807['attributes']=_0x4eb807[_0xec48('0x33')][_0xec48('0x35')]?_0x4eb807[_0xec48('0x33')]:_0x5b33ef[_0xec48('0x2d')];if(!_0x45371f[_0xec48('0x2f')]['hasOwnProperty'](_0xec48('0x37'))){_0x4eb807[_0xec48('0x1c')]=qs['limit'](_0x45371f[_0xec48('0x2f')]['limit']);_0x4eb807[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x45371f[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x4eb807['order']=qs[_0xec48('0x39')](_0x45371f[_0xec48('0x2f')][_0xec48('0x39')]);_0x4eb807[_0xec48('0x3a')]=qs['filters'](_[_0xec48('0x57')](_0x45371f[_0xec48('0x2f')],_0x5b33ef['filters']));_0x4eb807[_0xec48('0x3a')]['CampaignId']=_0x29e012['id'];if(_0x45371f['query'][_0xec48('0x3c')]){_0x4eb807[_0xec48('0x3a')]=_['merge'](_0x4eb807[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x4eb807[_0xec48('0x33')],function(_0x24a40a){var _0x5df7fc={};_0x5df7fc[_0x24a40a]={'$like':'%'+_0x45371f[_0xec48('0x2f')]['filter']+'%'};return _0x5df7fc;})});}_0x4eb807=_[_0xec48('0x3d')]({},_0x4eb807,_0x45371f[_0xec48('0x3e')]);return db[_0xec48('0x56')][_0xec48('0x1e')]({'where':_0x4eb807[_0xec48('0x3a')]})['then'](function(_0x516f34){_0x4a3974[_0xec48('0x1e')]=_0x516f34;if(_0x45371f[_0xec48('0x2f')][_0xec48('0x46')]){_0x4eb807[_0xec48('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0xec48('0x41')](_0x4eb807);})[_0xec48('0x25')](function(_0x2d874a){_0x4a3974['rows']=_0x2d874a;return _0x4a3974;});}})[_0xec48('0x25')](respondWithFilteredResult(_0xfcb3df,_0x4eb807))['catch'](handleError(_0xfcb3df,null));};exports['getHopperHistories']=function(_0x4012d6,_0x368838,_0x2fe4bd){var _0x5d5118={'raw':!![],'where':{}};var _0x38d97d={};var _0x54c790={'count':0x0,'rows':[]};return db[_0xec48('0x40')][_0xec48('0x58')]({'where':{'id':_0x4012d6[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x368838,null))[_0xec48('0x25')](function(_0x3708e7){if(_0x3708e7){_0x38d97d['model']=_[_0xec48('0x30')](db[_0xec48('0x59')][_0xec48('0x45')]);_0x38d97d[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x4012d6[_0xec48('0x2f')]);_0x38d97d[_0xec48('0x31')]=_[_0xec48('0x32')](_0x38d97d[_0xec48('0x2d')],_0x38d97d[_0xec48('0x2f')]);_0x5d5118[_0xec48('0x33')]=_['intersection'](_0x38d97d[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x34')]));_0x5d5118[_0xec48('0x33')]=_0x5d5118['attributes']['length']?_0x5d5118[_0xec48('0x33')]:_0x38d97d[_0xec48('0x2d')];if(!_0x4012d6['query'][_0xec48('0x36')](_0xec48('0x37'))){_0x5d5118[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x4012d6[_0xec48('0x2f')]['limit']);_0x5d5118[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x5d5118[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x39')]);_0x5d5118[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x4012d6[_0xec48('0x2f')],_0x38d97d[_0xec48('0x31')]));_0x5d5118['where'][_0xec48('0x5a')]=_0x3708e7['id'];if(_0x4012d6[_0xec48('0x2f')]['filter']){_0x5d5118['where']=_[_0xec48('0x3d')](_0x5d5118[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x5d5118[_0xec48('0x33')],function(_0x4fc35d){var _0x3fe956={};_0x3fe956[_0x4fc35d]={'$like':'%'+_0x4012d6['query']['filter']+'%'};return _0x3fe956;})});}_0x5d5118=_[_0xec48('0x3d')]({},_0x5d5118,_0x4012d6[_0xec48('0x3e')]);return db[_0xec48('0x59')]['count']({'where':_0x5d5118['where']})[_0xec48('0x25')](function(_0x1edb0c){_0x54c790[_0xec48('0x1e')]=_0x1edb0c;if(_0x4012d6[_0xec48('0x2f')]['includeAll']){_0x5d5118[_0xec48('0x3f')]=[{'all':!![]}];}return db[_0xec48('0x59')]['findAll'](_0x5d5118);})[_0xec48('0x25')](function(_0x55bd3f){_0x54c790[_0xec48('0x42')]=_0x55bd3f;return _0x54c790;});}})['then'](respondWithFilteredResult(_0x368838,_0x5d5118))[_0xec48('0x51')](handleError(_0x368838,null));};exports['getHopperFinals']=function(_0x14d1aa,_0x191ec0,_0x38c984){var _0x46d04f={'raw':!![],'where':{}};var _0x56223a={};var _0x288cd9={'count':0x0,'rows':[]};return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x14d1aa['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x191ec0,null))[_0xec48('0x25')](function(_0x97717c){if(_0x97717c){_0x56223a['model']=_['keys'](db[_0xec48('0x5b')][_0xec48('0x45')]);_0x56223a[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x14d1aa[_0xec48('0x2f')]);_0x56223a[_0xec48('0x31')]=_[_0xec48('0x32')](_0x56223a[_0xec48('0x2d')],_0x56223a['query']);_0x46d04f[_0xec48('0x33')]=_['intersection'](_0x56223a[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x14d1aa[_0xec48('0x2f')][_0xec48('0x34')]));_0x46d04f['attributes']=_0x46d04f[_0xec48('0x33')][_0xec48('0x35')]?_0x46d04f['attributes']:_0x56223a[_0xec48('0x2d')];if(!_0x14d1aa['query'][_0xec48('0x36')](_0xec48('0x37'))){_0x46d04f['limit']=qs[_0xec48('0x1c')](_0x14d1aa[_0xec48('0x2f')][_0xec48('0x1c')]);_0x46d04f[_0xec48('0x1f')]=qs['offset'](_0x14d1aa['query'][_0xec48('0x1f')]);}_0x46d04f['order']=qs[_0xec48('0x39')](_0x14d1aa['query'][_0xec48('0x39')]);_0x46d04f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x14d1aa[_0xec48('0x2f')],_0x56223a[_0xec48('0x31')]));_0x46d04f[_0xec48('0x3a')][_0xec48('0x5a')]=_0x97717c['id'];if(_0x14d1aa[_0xec48('0x2f')][_0xec48('0x3c')]){_0x46d04f['where']=_[_0xec48('0x3d')](_0x46d04f[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x46d04f[_0xec48('0x33')],function(_0x3bc9fd){var _0x3ba6bb={};_0x3ba6bb[_0x3bc9fd]={'$like':'%'+_0x14d1aa['query']['filter']+'%'};return _0x3ba6bb;})});}_0x46d04f=_[_0xec48('0x3d')]({},_0x46d04f,_0x14d1aa['options']);return db['CmHopperFinal'][_0xec48('0x1e')]({'where':_0x46d04f[_0xec48('0x3a')]})[_0xec48('0x25')](function(_0x39a06e){_0x288cd9[_0xec48('0x1e')]=_0x39a06e;if(_0x14d1aa[_0xec48('0x2f')][_0xec48('0x46')]){_0x46d04f[_0xec48('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xec48('0x41')](_0x46d04f);})[_0xec48('0x25')](function(_0x1b2afa){_0x288cd9[_0xec48('0x42')]=_0x1b2afa;return _0x288cd9;});}})[_0xec48('0x25')](respondWithFilteredResult(_0x191ec0,_0x46d04f))['catch'](handleError(_0x191ec0,null));};exports[_0xec48('0x5c')]=function(_0x5a1881,_0x3a4f0d,_0x4f4da9){var _0x5c073f={'raw':!![],'where':{}};var _0xd33994={};var _0x422104={'count':0x0,'rows':[]};return db[_0xec48('0x40')][_0xec48('0x58')]({'where':{'id':_0x5a1881['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x3a4f0d,null))[_0xec48('0x25')](function(_0x42d386){if(_0x42d386){_0xd33994[_0xec48('0x2d')]=_[_0xec48('0x30')](db['CmHopperBlack'][_0xec48('0x45')]);_0xd33994[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x5a1881[_0xec48('0x2f')]);_0xd33994['filters']=_[_0xec48('0x32')](_0xd33994[_0xec48('0x2d')],_0xd33994['query']);_0x5c073f['attributes']=_['intersection'](_0xd33994['model'],qs[_0xec48('0x34')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x34')]));_0x5c073f[_0xec48('0x33')]=_0x5c073f[_0xec48('0x33')]['length']?_0x5c073f['attributes']:_0xd33994['model'];if(!_0x5a1881['query'][_0xec48('0x36')]('nolimit')){_0x5c073f['limit']=qs[_0xec48('0x1c')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x1c')]);_0x5c073f[_0xec48('0x1f')]=qs['offset'](_0x5a1881['query'][_0xec48('0x1f')]);}_0x5c073f[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x39')]);_0x5c073f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x5a1881[_0xec48('0x2f')],_0xd33994[_0xec48('0x31')]));_0x5c073f[_0xec48('0x3a')][_0xec48('0x5a')]=_0x42d386['id'];if(_0x5a1881['query'][_0xec48('0x3c')]){_0x5c073f['where']=_[_0xec48('0x3d')](_0x5c073f[_0xec48('0x3a')],{'$or':_['map'](_0x5c073f[_0xec48('0x33')],function(_0x5d08e3){var _0x56a7da={};_0x56a7da[_0x5d08e3]={'$like':'%'+_0x5a1881[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x56a7da;})});}_0x5c073f=_[_0xec48('0x3d')]({},_0x5c073f,_0x5a1881[_0xec48('0x3e')]);return db['CmHopperBlack'][_0xec48('0x1e')]({'where':_0x5c073f[_0xec48('0x3a')]})[_0xec48('0x25')](function(_0x14cc3a){_0x422104['count']=_0x14cc3a;if(_0x5a1881[_0xec48('0x2f')]['includeAll']){_0x5c073f['include']=[{'all':!![]}];}return db[_0xec48('0x5d')]['findAll'](_0x5c073f);})[_0xec48('0x25')](function(_0x548e80){_0x422104[_0xec48('0x42')]=_0x548e80;return _0x422104;});}})[_0xec48('0x25')](respondWithFilteredResult(_0x3a4f0d,_0x5c073f))[_0xec48('0x51')](handleError(_0x3a4f0d,null));};exports['getLists']=function(_0x5a68bf,_0x4590a5,_0x2945c9){var _0x39447c={};var _0x3605d3={};var _0x33317c;var _0x48d9ed;return db['Campaign'][_0xec48('0x58')]({'where':{'id':_0x5a68bf[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x4590a5,null))[_0xec48('0x25')](function(_0x391a60){if(_0x391a60){_0x33317c=_0x391a60;_0x3605d3['model']=_[_0xec48('0x30')](db['CmList']['rawAttributes']);_0x3605d3['query']=_[_0xec48('0x30')](_0x5a68bf[_0xec48('0x2f')]);_0x3605d3[_0xec48('0x31')]=_['intersection'](_0x3605d3['model'],_0x3605d3[_0xec48('0x2f')]);_0x39447c['attributes']=_['intersection'](_0x3605d3[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x5a68bf['query'][_0xec48('0x34')]));_0x39447c[_0xec48('0x33')]=_0x39447c['attributes'][_0xec48('0x35')]?_0x39447c[_0xec48('0x33')]:_0x3605d3[_0xec48('0x2d')];_0x39447c['order']=qs['sort'](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x39')]);_0x39447c[_0xec48('0x3a')]=qs[_0xec48('0x31')](_['pick'](_0x5a68bf[_0xec48('0x2f')],_0x3605d3['filters']));if(_0x5a68bf['query'][_0xec48('0x3c')]){_0x39447c['where']=_['merge'](_0x39447c[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x39447c[_0xec48('0x33')],function(_0x678cc3){var _0x1de685={};_0x1de685[_0x678cc3]={'$like':'%'+_0x5a68bf['query'][_0xec48('0x3c')]+'%'};return _0x1de685;})});}_0x39447c=_[_0xec48('0x3d')]({},_0x39447c,_0x5a68bf[_0xec48('0x3e')]);return _0x33317c[_0xec48('0x5e')](_0x39447c);}})['then'](function(_0x2ee2c0){if(_0x2ee2c0){_0x48d9ed=_0x2ee2c0[_0xec48('0x35')];if(!_0x5a68bf[_0xec48('0x2f')][_0xec48('0x36')]('nolimit')){_0x39447c[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x1c')]);_0x39447c[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x1f')]);}return _0x33317c[_0xec48('0x5e')](_0x39447c);}})[_0xec48('0x25')](function(_0x4a2c6e){if(_0x4a2c6e){return _0x4a2c6e?{'count':_0x48d9ed,'rows':_0x4a2c6e}:null;}})[_0xec48('0x25')](respondWithResult(_0x4590a5,null))[_0xec48('0x51')](handleError(_0x4590a5,null));};exports[_0xec48('0x5f')]=function(_0x3ddebc,_0x11c59a,_0x560a75){var _0x4eab6c,_0x5efb48;var _0x43a879=[];var _0x426004=moment()['format'](_0xec48('0x60'));return db['Campaign'][_0xec48('0x47')]({'where':{'id':_0x3ddebc['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x11c59a,null))[_0xec48('0x25')](function(_0x5c6c53){if(_0x5c6c53){_0x5efb48=_0x5c6c53;return _0x5c6c53['addLists'](_0x3ddebc['body'][_0xec48('0x61')],_['omit'](_0x3ddebc[_0xec48('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0xa38d94){var _0x2375a2;var _0x3a79af;_0x4eab6c=_0xa38d94||[];var _0x1ae869=[];if(_0xa38d94){for(var _0x4fe934=0x0;_0x4fe934<_0xa38d94[_0xec48('0x35')];_0x4fe934+=0x1){var _0x203cc4=_0xa38d94[_0x4fe934][_0xec48('0x26')]({'plain':!![]});_0x5efb48[_0xec48('0x62')]=_0x3ddebc[_0xec48('0x49')][_0xec48('0x62')]?_0x3ddebc[_0xec48('0x49')]['dialCheckDuplicateType']:_0x5efb48[_0xec48('0x62')];switch(_0x5efb48[_0xec48('0x62')]){case'always':_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))['fromQuery']([_0xec48('0x66'),_0xec48('0x67'),_0xec48('0x68'),_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()['field'](_0xec48('0x66'),_0xec48('0x66'))['field'](_0xec48('0x6c'),_0xec48('0x67'))['field']('id',_0xec48('0x68'))[_0xec48('0x6d')](_0x203cc4['CmListId'][_0xec48('0x6e')](),_0xec48('0x69'))['field'](_0x3ddebc['params']['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27','createdAt')[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x6a'))[_0xec48('0x6f')](_0xec48('0x70'))[_0xec48('0x3a')]('deletedAt\x20IS\x20NULL')[_0xec48('0x3a')](_0xec48('0x71'),_0x203cc4[_0xec48('0x72')][_0xec48('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xec48('0x73'),squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x74'))[_0xec48('0x6f')](_0xec48('0x75'))['where'](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')]()))[_0xec48('0x3a')](_0xec48('0x73'),squel[_0xec48('0x6b')]()['field'](_0xec48('0x77'))[_0xec48('0x6f')](_0xec48('0x65'))[_0xec48('0x3a')](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id']['toString']())))[_0xec48('0x6e')]();break;case _0xec48('0x78'):_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))[_0xec48('0x79')]([_0xec48('0x66'),_0xec48('0x67'),'ContactId',_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x66'),_0xec48('0x66'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x67'))[_0xec48('0x6d')]('id',_0xec48('0x68'))[_0xec48('0x6d')](_0x203cc4[_0xec48('0x72')]['toString'](),'ListId')[_0xec48('0x6d')](_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x6a'))[_0xec48('0x6f')]('cm_contacts')[_0xec48('0x3a')](_0xec48('0x7a'))[_0xec48('0x3a')](_0xec48('0x71'),_0x203cc4['CmListId'][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x7b'))[_0xec48('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xec48('0x6b')]()['field'](_0xec48('0x77'))[_0xec48('0x6f')](_0xec48('0x65'))[_0xec48('0x3a')](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')]())))[_0xec48('0x6e')]();break;default:_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))[_0xec48('0x79')](['phone','scheduledAt',_0xec48('0x68'),_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()['field'](_0xec48('0x66'),_0xec48('0x66'))[_0xec48('0x6d')](_0xec48('0x6c'),'scheduledAt')[_0xec48('0x6d')]('id','ContactId')[_0xec48('0x6d')](_0x203cc4[_0xec48('0x72')]['toString'](),_0xec48('0x69'))[_0xec48('0x6d')](_0x3ddebc[_0xec48('0x44')]['id']['toString'](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))['field']('\x27'+_0x426004+'\x27',_0xec48('0x6a'))['from']('cm_contacts')['where'](_0xec48('0x7a'))[_0xec48('0x3a')]('ListId\x20=\x20?',_0x203cc4[_0xec48('0x72')][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x7b')))[_0xec48('0x6e')]();}_0x3a79af=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x7c'))[_0xec48('0x79')]([_0xec48('0x7d'),_0xec48('0x67'),_0xec48('0x66'),'OrderBy',_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x7e'),'id')[_0xec48('0x6d')](_0xec48('0x6c'),'scheduledAt')[_0xec48('0x6d')]('ci.item','phone')[_0xec48('0x6d')](_0xec48('0x7f'),'OrderBy')[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))['field']('\x27'+_0x426004+'\x27',_0xec48('0x6a'))['from'](_0xec48('0x80'),'ci')['join'](_0xec48('0x65'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xec48('0x3a')](_0xec48('0x81'),_0x203cc4['CmListId'][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x82'),_0x3ddebc[_0xec48('0x44')]['id']['toString']())[_0xec48('0x3a')](_0xec48('0x83'),_0x426004))['toString']();_0x1ae869[_0xec48('0x84')](db[_0xec48('0x85')][_0xec48('0x2f')](_0x2375a2));_0x43a879[_0xec48('0x84')](db['sequelize']['query'](_0x3a79af));}return BPromise[_0xec48('0x86')](_0x1ae869);}})[_0xec48('0x25')](function(){return BPromise['all'](_0x43a879);})['then'](function(){return _0x4eab6c;})[_0xec48('0x25')](respondWithResult(_0x11c59a,null))[_0xec48('0x51')](handleError(_0x11c59a,null));};exports[_0xec48('0x87')]=function(_0x3c3ffc,_0x5662fe,_0x45b849){return db[_0xec48('0x40')]['find']({'where':{'id':_0x3c3ffc['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x5662fe,null))['then'](function(_0x100f3c){if(_0x100f3c){return _0x100f3c[_0xec48('0x87')](_0x3c3ffc[_0xec48('0x2f')][_0xec48('0x61')]);}})['then'](function(_0x389f08){if(_0x389f08){return db[_0xec48('0x56')][_0xec48('0x24')]({'where':{'ListId':_0x3c3ffc[_0xec48('0x2f')][_0xec48('0x61')],'CampaignId':_0x3c3ffc['params']['id']}})[_0xec48('0x25')](function(){return _0x389f08;});}})[_0xec48('0x25')](respondWithStatusCode(_0x5662fe,null))[_0xec48('0x51')](handleError(_0x5662fe,null));};exports[_0xec48('0x88')]=function(_0x282721,_0x4bc9e3,_0x5eff45){var _0x58b3e4={};var _0x19e37b={};var _0x2b1b9a;var _0x57871b;return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x282721['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x4bc9e3,null))[_0xec48('0x25')](function(_0x1bb002){if(_0x1bb002){_0x2b1b9a=_0x1bb002;_0x19e37b[_0xec48('0x2d')]=_[_0xec48('0x30')](db[_0xec48('0x89')][_0xec48('0x45')]);_0x19e37b['query']=_[_0xec48('0x30')](_0x282721[_0xec48('0x2f')]);_0x19e37b['filters']=_['intersection'](_0x19e37b[_0xec48('0x2d')],_0x19e37b[_0xec48('0x2f')]);_0x58b3e4[_0xec48('0x33')]=_[_0xec48('0x32')](_0x19e37b[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x282721[_0xec48('0x2f')][_0xec48('0x34')]));_0x58b3e4[_0xec48('0x33')]=_0x58b3e4[_0xec48('0x33')][_0xec48('0x35')]?_0x58b3e4[_0xec48('0x33')]:_0x19e37b[_0xec48('0x2d')];_0x58b3e4[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x282721['query'][_0xec48('0x39')]);_0x58b3e4[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x282721['query'],_0x19e37b['filters']));if(_0x282721[_0xec48('0x2f')][_0xec48('0x3c')]){_0x58b3e4[_0xec48('0x3a')]=_[_0xec48('0x3d')](_0x58b3e4[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x58b3e4[_0xec48('0x33')],function(_0x126301){var _0x488d5e={};_0x488d5e[_0x126301]={'$like':'%'+_0x282721[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x488d5e;})});}_0x58b3e4=_['merge']({},_0x58b3e4,_0x282721[_0xec48('0x3e')]);return _0x2b1b9a[_0xec48('0x88')](_0x58b3e4);}})[_0xec48('0x25')](function(_0x2695e5){if(_0x2695e5){_0x57871b=_0x2695e5[_0xec48('0x35')];if(!_0x282721[_0xec48('0x2f')][_0xec48('0x36')](_0xec48('0x37'))){_0x58b3e4[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x282721[_0xec48('0x2f')]['limit']);_0x58b3e4['offset']=qs['offset'](_0x282721[_0xec48('0x2f')][_0xec48('0x1f')]);}return _0x2b1b9a[_0xec48('0x88')](_0x58b3e4);}})[_0xec48('0x25')](function(_0x4fd407){if(_0x4fd407){return _0x4fd407?{'count':_0x57871b,'rows':_0x4fd407}:null;}})[_0xec48('0x25')](respondWithResult(_0x4bc9e3,null))[_0xec48('0x51')](handleError(_0x4bc9e3,null));};exports['addBlackLists']=function(_0x40d520,_0x9424e5,_0x1b51c1){var _0xd89d7,_0x4292ac;var _0xb44f1d=[];var _0x15bca9=moment()[_0xec48('0x8a')](_0xec48('0x60'));return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x40d520['params']['id']}})['then'](handleEntityNotFound(_0x9424e5,null))[_0xec48('0x25')](function(_0x2beae6){if(_0x2beae6){_0x4292ac=_0x2beae6;return _0x2beae6[_0xec48('0x8b')](_0x40d520[_0xec48('0x49')][_0xec48('0x61')],_[_0xec48('0x53')](_0x40d520[_0xec48('0x49')],['ids','id'])||{});}return null;})[_0xec48('0x8c')](function(_0x1ae850){var _0x33d84c;var _0x400c71;_0xd89d7=_0x1ae850||[];var _0x13171e=[];if(_0x1ae850){for(var _0x45f111=0x0;_0x45f111<_0x1ae850[_0xec48('0x35')];_0x45f111+=0x1){var _0x33d08d=_0x1ae850[_0x45f111][_0xec48('0x26')]({'plain':!![]});_0x33d84c=squel[_0xec48('0x63')]()[_0xec48('0x64')]('cm_hopper_black')[_0xec48('0x79')](['phone','ContactId',_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel['select']()['field'](_0xec48('0x66'),_0xec48('0x66'))['field']('id',_0xec48('0x68'))['field'](_0x33d08d[_0xec48('0x72')][_0xec48('0x6e')](),_0xec48('0x69'))['field'](_0x40d520[_0xec48('0x44')]['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x54'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x6a'))[_0xec48('0x6f')](_0xec48('0x70'))[_0xec48('0x3a')](_0xec48('0x7a'))[_0xec48('0x3a')](_0xec48('0x71'),_0x33d08d[_0xec48('0x72')][_0xec48('0x6e')]())[_0xec48('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xec48('0x6e')]();_0x13171e['push'](db['sequelize'][_0xec48('0x2f')](_0x33d84c));}return BPromise[_0xec48('0x86')](_0x13171e);}})[_0xec48('0x25')](function(){return _0xd89d7;})[_0xec48('0x25')](respondWithResult(_0x9424e5,null))[_0xec48('0x51')](handleError(_0x9424e5,null));};exports[_0xec48('0x8d')]=function(_0x576520,_0x4402b9,_0x1df1e9){return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x576520[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x4402b9,null))[_0xec48('0x25')](function(_0x1839b2){if(_0x1839b2){return _0x1839b2[_0xec48('0x8d')](_0x576520[_0xec48('0x2f')][_0xec48('0x61')]);}})['then'](function(_0x23f53e){if(_0x23f53e){return db[_0xec48('0x5d')][_0xec48('0x24')]({'where':{'ListId':_0x576520[_0xec48('0x2f')][_0xec48('0x61')],'CampaignId':_0x576520[_0xec48('0x44')]['id']}})[_0xec48('0x25')](function(){return _0x23f53e;});}})[_0xec48('0x25')](respondWithStatusCode(_0x4402b9,null))['catch'](handleError(_0x4402b9,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 49e04f2..ff7cfa8 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x7a54,0x106));var _0x47a5=function(_0x56a8ee,_0x3b1ccd){_0x56a8ee=_0x56a8ee-0x0;var _0x813043=_0x7a54[_0x56a8ee];return _0x813043;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 6a667ac..e36badf 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 _0xf958=['message','catch','Campaign','findAll','options','where','limit','map','model','include','attributes','GetCampaign','stringify','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4ecb9b,_0xb2c16b){var _0x451ffb=function(_0x377db2){while(--_0x377db2){_0x4ecb9b['push'](_0x4ecb9b['shift']());}};_0x451ffb(++_0xb2c16b);}(_0xf958,0xe6));var _0x8f95=function(_0x2aa68f,_0x809c6c){_0x2aa68f=_0x2aa68f-0x0;var _0x2a6472=_0xf958[_0x2aa68f];return _0x2a6472;};'use strict';var _=require(_0x8f95('0x0'));var util=require('util');var moment=require(_0x8f95('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f95('0x3'))['db'];var utils=require(_0x8f95('0x4'));var logger=require(_0x8f95('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f95('0x6'));var client=jayson[_0x8f95('0x7')][_0x8f95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c2af8,_0x5cfc04,_0x1ae9c4){return new BPromise(function(_0x109bed,_0x435b5b){return client[_0x8f95('0x9')](_0x5c2af8,_0x1ae9c4)[_0x8f95('0xa')](function(_0x585025){logger[_0x8f95('0xb')](_0x8f95('0xc'),_0x5cfc04,'request\x20sent');logger[_0x8f95('0xd')](_0x8f95('0xe'),_0x5cfc04,_0x8f95('0xf'),JSON['stringify'](_0x585025));if(_0x585025[_0x8f95('0x10')]){if(_0x585025[_0x8f95('0x10')][_0x8f95('0x11')]===0x1f4){logger['error'](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x435b5b(_0x585025['error'][_0x8f95('0x12')]);}logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x109bed(_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x5cfc04,'request\x20sent');_0x109bed(_0x585025['result']['message']);}})[_0x8f95('0x13')](function(_0x2f01cd){logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x2f01cd);_0x435b5b(_0x2f01cd);});});}exports['GetCampaign']=function(_0x5da758){var _0x14d21f=this;return new Promise(function(_0x17b85b,_0x55ba7f){return db[_0x8f95('0x14')][_0x8f95('0x15')]({'raw':_0x5da758[_0x8f95('0x16')]?_0x5da758[_0x8f95('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5da758[_0x8f95('0x16')]?_0x5da758[_0x8f95('0x16')][_0x8f95('0x17')]||null:null,'attributes':_0x5da758[_0x8f95('0x16')]?_0x5da758['options']['attributes']||null:null,'limit':_0x5da758[_0x8f95('0x16')]?_0x5da758[_0x8f95('0x16')][_0x8f95('0x18')]||null:null,'include':_0x5da758[_0x8f95('0x16')]?_0x5da758[_0x8f95('0x16')]['include']?_[_0x8f95('0x19')](_0x5da758[_0x8f95('0x16')]['include'],function(_0x205c3e){return{'model':db[_0x205c3e[_0x8f95('0x1a')]],'as':_0x205c3e['as'],'attributes':_0x205c3e['attributes'],'include':_0x205c3e[_0x8f95('0x1b')]?_[_0x8f95('0x19')](_0x205c3e[_0x8f95('0x1b')],function(_0xb00b6f){return{'model':db[_0xb00b6f['model']],'as':_0xb00b6f['as'],'attributes':_0xb00b6f[_0x8f95('0x1c')],'include':_0xb00b6f['include']?_['map'](_0xb00b6f[_0x8f95('0x1b')],function(_0x5dabb6){return{'model':db[_0x5dabb6[_0x8f95('0x1a')]],'as':_0x5dabb6['as'],'attributes':_0x5dabb6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x312658){logger['info'](_0x8f95('0x1d'),_0x5da758);logger['debug'](_0x8f95('0x1d'),_0x5da758,JSON[_0x8f95('0x1e')](_0x312658));_0x17b85b(_0x312658);})[_0x8f95('0x13')](function(_0x2bb4ea){logger[_0x8f95('0x10')](_0x8f95('0x1d'),_0x2bb4ea[_0x8f95('0x12')],_0x5da758);_0x55ba7f(_0x14d21f[_0x8f95('0x10')](0x1f4,_0x2bb4ea[_0x8f95('0x12')]));});});};
\ No newline at end of file
+var _0x7333=['info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x7333,0xfc));var _0x3733=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7333[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var moment=require(_0x3733('0x1'));var BPromise=require('bluebird');var rs=require(_0x3733('0x2'));var fs=require('fs');var Redis=require(_0x3733('0x3'));var db=require(_0x3733('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3733('0x5'))(_0x3733('0x6'));var config=require(_0x3733('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3733('0x8')][_0x3733('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3330c6,_0x3aab36,_0x5b5a50){return new BPromise(function(_0x1ee542,_0x5b184b){return client[_0x3733('0xa')](_0x3330c6,_0x5b5a50)[_0x3733('0xb')](function(_0x3bf4bc){logger[_0x3733('0xc')]('Campaign,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));logger['debug'](_0x3733('0xe'),_0x3aab36,_0x3733('0xd'),JSON[_0x3733('0xf')](_0x3bf4bc));if(_0x3bf4bc[_0x3733('0x10')]){if(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x11')]===0x1f4){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x5b184b(_0x3bf4bc[_0x3733('0x10')]['message']);}logger['error'](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x1ee542(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);}else{logger[_0x3733('0xc')]('Campaign,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));_0x1ee542(_0x3bf4bc[_0x3733('0x14')][_0x3733('0x13')]);}})[_0x3733('0x15')](function(_0x56c17a){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x56c17a);_0x5b184b(_0x56c17a);});});}exports[_0x3733('0x16')]=function(_0xd0f743){var _0x497600=this;return new Promise(function(_0x24a91e,_0x328490){return db[_0x3733('0x17')][_0x3733('0x18')]({'raw':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1a')]===undefined?!![]:![]:!![],'where':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')]['where']||null:null,'attributes':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1b')]||null:null,'limit':_0xd0f743['options']?_0xd0f743[_0x3733('0x19')][_0x3733('0x1c')]||null:null,'include':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1d')]?_[_0x3733('0x1e')](_0xd0f743[_0x3733('0x19')]['include'],function(_0x3187a3){return{'model':db[_0x3187a3['model']],'as':_0x3187a3['as'],'attributes':_0x3187a3[_0x3733('0x1b')],'include':_0x3187a3[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3187a3[_0x3733('0x1d')],function(_0x3f77d0){return{'model':db[_0x3f77d0[_0x3733('0x1f')]],'as':_0x3f77d0['as'],'attributes':_0x3f77d0[_0x3733('0x1b')],'include':_0x3f77d0[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3f77d0['include'],function(_0x1ce6c1){return{'model':db[_0x1ce6c1['model']],'as':_0x1ce6c1['as'],'attributes':_0x1ce6c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3733('0xb')](function(_0x12169e){logger[_0x3733('0xc')]('GetCampaign',_0xd0f743);logger[_0x3733('0x20')](_0x3733('0x16'),_0xd0f743,JSON[_0x3733('0xf')](_0x12169e));_0x24a91e(_0x12169e);})[_0x3733('0x15')](function(_0x13b66e){logger[_0x3733('0x10')](_0x3733('0x16'),_0x13b66e['message'],_0xd0f743);_0x328490(_0x497600[_0x3733('0x10')](0x1f4,_0x13b66e[_0x3733('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 84998eb..695f03a 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 _0x4c62=['removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists'];(function(_0x14ea32,_0x262909){var _0x137bbb=function(_0x4a36ab){while(--_0x4a36ab){_0x14ea32['push'](_0x14ea32['shift']());}};_0x137bbb(++_0x262909);}(_0x4c62,0x18e));var _0x24c6=function(_0x53278c,_0x358eab){_0x53278c=_0x53278c-0x0;var _0x35ebb2=_0x4c62[_0x53278c];return _0x35ebb2;};'use strict';var multer=require(_0x24c6('0x0'));var util=require(_0x24c6('0x1'));var path=require(_0x24c6('0x2'));var timeout=require('connect-timeout');var express=require(_0x24c6('0x3'));var router=express[_0x24c6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x24c6('0x5'));var interaction=require(_0x24c6('0x6'));var config=require(_0x24c6('0x7'));var controller=require(_0x24c6('0x8'));router[_0x24c6('0x9')]('/',auth[_0x24c6('0xa')](),controller[_0x24c6('0xb')]);router['get'](_0x24c6('0xc'),auth[_0x24c6('0xa')](),controller[_0x24c6('0xd')]);router['get']('/:id/hoppers',auth[_0x24c6('0xa')](),controller[_0x24c6('0xe')]);router[_0x24c6('0x9')](_0x24c6('0xf'),auth[_0x24c6('0xa')](),controller['getHopperHistories']);router[_0x24c6('0x9')]('/:id/hopper_finals',auth[_0x24c6('0xa')](),controller[_0x24c6('0x10')]);router[_0x24c6('0x9')](_0x24c6('0x11'),auth[_0x24c6('0xa')](),controller['getHopperBlacks']);router[_0x24c6('0x9')](_0x24c6('0x12'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x13')]);router[_0x24c6('0x9')](_0x24c6('0x14'),auth[_0x24c6('0xa')](),controller['getBlackLists']);router[_0x24c6('0x15')]('/',auth[_0x24c6('0xa')](),controller[_0x24c6('0x16')]);router[_0x24c6('0x15')](_0x24c6('0x17'),auth['isAuthenticated'](),controller[_0x24c6('0x18')]);router[_0x24c6('0x15')](_0x24c6('0x12'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x19')]);router[_0x24c6('0x15')](_0x24c6('0x14'),auth['isAuthenticated'](),controller[_0x24c6('0x1a')]);router['put'](_0x24c6('0xc'),auth['isAuthenticated'](),controller[_0x24c6('0x1b')]);router[_0x24c6('0x1c')](_0x24c6('0xc'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x1d')]);router[_0x24c6('0x1c')](_0x24c6('0x12'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x1e')]);router['delete'](_0x24c6('0x14'),auth[_0x24c6('0xa')](),controller[_0x24c6('0x1f')]);module[_0x24c6('0x20')]=router;
\ No newline at end of file
+var _0xcf33=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path'];(function(_0x25fc59,_0x4711cf){var _0x3bf8c5=function(_0x4f1ea2){while(--_0x4f1ea2){_0x25fc59['push'](_0x25fc59['shift']());}};_0x3bf8c5(++_0x4711cf);}(_0xcf33,0x10d));var _0x3cf3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf33[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x3cf3('0x0'));var util=require(_0x3cf3('0x1'));var path=require(_0x3cf3('0x2'));var timeout=require(_0x3cf3('0x3'));var express=require('express');var router=express[_0x3cf3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3cf3('0x5'));var interaction=require(_0x3cf3('0x6'));var config=require(_0x3cf3('0x7'));var controller=require('./campaign.controller');router[_0x3cf3('0x8')]('/',auth[_0x3cf3('0x9')](),controller['index']);router[_0x3cf3('0x8')](_0x3cf3('0xa'),auth['isAuthenticated'](),controller[_0x3cf3('0xb')]);router['get'](_0x3cf3('0xc'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xd')]);router[_0x3cf3('0x8')]('/:id/hopper_histories',auth[_0x3cf3('0x9')](),controller['getHopperHistories']);router[_0x3cf3('0x8')]('/:id/hopper_finals',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xe')]);router[_0x3cf3('0x8')](_0x3cf3('0xf'),auth['isAuthenticated'](),controller[_0x3cf3('0x10')]);router['get'](_0x3cf3('0x11'),auth['isAuthenticated'](),controller[_0x3cf3('0x12')]);router[_0x3cf3('0x8')](_0x3cf3('0x13'),auth['isAuthenticated'](),controller[_0x3cf3('0x14')]);router[_0x3cf3('0x15')]('/',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x16')]);router['post'](_0x3cf3('0x17'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x18')]);router['post'](_0x3cf3('0x11'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x19')]);router[_0x3cf3('0x15')](_0x3cf3('0x13'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1a')]);router[_0x3cf3('0x1b')](_0x3cf3('0xa'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1c')]);router['delete']('/:id',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1d')]);router['delete'](_0x3cf3('0x11'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1e')]);router[_0x3cf3('0x1f')](_0x3cf3('0x13'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x20')]);module[_0x3cf3('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index d3b9dfb..7c8458d 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 _0x84c2=['VIRTUAL','getDataValue','key','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x84c2,0x1eb));var _0x284c=function(_0x42e873,_0xff4f2a){_0x42e873=_0x42e873-0x0;var _0xc90c74=_0x84c2[_0x42e873];return _0xc90c74;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x284c('0x0')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x284c('0x0')]},'name':{'type':Sequelize[_0x284c('0x1')],'get':function(){return this[_0x284c('0x2')](_0x284c('0x3'));}}};
\ No newline at end of file
+var _0x8daa=['exports','STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x15aadf,_0x144c83){var _0x75c612=function(_0x37bb40){while(--_0x37bb40){_0x15aadf['push'](_0x15aadf['shift']());}};_0x75c612(++_0x144c83);}(_0x8daa,0x102));var _0xa8da=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0x8daa[_0x12b683];return _0xfb150b;};'use strict';var Sequelize=require(_0xa8da('0x0'));module[_0xa8da('0x1')]={'key':{'type':Sequelize[_0xa8da('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa8da('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa8da('0x4')],'get':function(){return this[_0xa8da('0x5')](_0xa8da('0x6'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index bb96097..38eb8d7 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 _0x6b98=['autoAssociation','error','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','stack','name','send','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','CannedAnswer','includeAll','include','findAll','rows','catch','rawAttributes','update','body','params','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId'];(function(_0x323970,_0x5bde6f){var _0x3217da=function(_0x4dcdf3){while(--_0x4dcdf3){_0x323970['push'](_0x323970['shift']());}};_0x3217da(++_0x5bde6f);}(_0x6b98,0x110));var _0x86b9=function(_0x4e9f1a,_0x35e3f3){_0x4e9f1a=_0x4e9f1a-0x0;var _0x441f20=_0x6b98[_0x4e9f1a];return _0x441f20;};'use strict';var emlformat=require(_0x86b9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x86b9('0x1'));var rp=require(_0x86b9('0x2'));var moment=require(_0x86b9('0x3'));var BPromise=require(_0x86b9('0x4'));var Mustache=require(_0x86b9('0x5'));var util=require('util');var path=require(_0x86b9('0x6'));var sox=require(_0x86b9('0x7'));var csv=require(_0x86b9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86b9('0x9'));var _=require('lodash');var squel=require(_0x86b9('0xa'));var crypto=require(_0x86b9('0xb'));var jsforce=require(_0x86b9('0xc'));var deskjs=require(_0x86b9('0xd'));var toCsv=require(_0x86b9('0x8'));var querystring=require(_0x86b9('0xe'));var Papa=require(_0x86b9('0xf'));var Redis=require('ioredis');var authService=require(_0x86b9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x86b9('0x11'));var hardwareService=require(_0x86b9('0x12'));var logger=require(_0x86b9('0x13'))(_0x86b9('0x14'));var utils=require(_0x86b9('0x15'));var config=require(_0x86b9('0x16'));var licenseUtil=require(_0x86b9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59cfd8,_0x2ef526){_0x2ef526=_0x2ef526||0xcc;return function(_0x213f50){if(_0x213f50){return _0x59cfd8[_0x86b9('0x18')](_0x2ef526);}return _0x59cfd8[_0x86b9('0x19')](_0x2ef526)[_0x86b9('0x1a')]();};}function respondWithResult(_0x357003,_0x590ca0){_0x590ca0=_0x590ca0||0xc8;return function(_0x82173c){if(_0x82173c){return _0x357003[_0x86b9('0x19')](_0x590ca0)['json'](_0x82173c);}};}function respondWithFilteredResult(_0x1926d4,_0x55a60d){return function(_0xfc7202){if(_0xfc7202){var _0x243e2a=typeof _0x55a60d['offset']==='undefined'&&typeof _0x55a60d['limit']===_0x86b9('0x1b');var _0x458c8c=_0xfc7202[_0x86b9('0x1c')];var _0x21f44d=_0x243e2a?0x0:_0x55a60d[_0x86b9('0x1d')];var _0x56e428=_0x243e2a?_0xfc7202['count']:_0x55a60d['offset']+_0x55a60d[_0x86b9('0x1e')];var _0x17ef11;if(_0x56e428>=_0x458c8c){_0x56e428=_0x458c8c;_0x17ef11=0xc8;}else{_0x17ef11=0xce;}_0x1926d4[_0x86b9('0x19')](_0x17ef11);return _0x1926d4[_0x86b9('0x1f')](_0x86b9('0x20'),_0x21f44d+'-'+_0x56e428+'/'+_0x458c8c)['json'](_0xfc7202);}return null;};}function patchUpdates(_0x7602b9){return function(_0x5c48de){try{jsonpatch[_0x86b9('0x21')](_0x5c48de,_0x7602b9,!![]);}catch(_0x34e18b){return BPromise[_0x86b9('0x22')](_0x34e18b);}return _0x5c48de[_0x86b9('0x23')]();};}function saveUpdates(_0x1f7c73,_0x587439){return function(_0x33b590){if(_0x33b590){return _0x33b590['update'](_0x1f7c73)['then'](function(_0x47140b){return _0x47140b;});}return null;};}function removeEntity(_0x49295b,_0x416a7f){return function(_0xe73706){if(_0xe73706){return _0xe73706[_0x86b9('0x24')]()[_0x86b9('0x25')](function(){var _0x56d0f7=_0xe73706[_0x86b9('0x26')]({'plain':!![]});var _0x10af5d='CannedAnswers';return db[_0x86b9('0x27')]['destroy']({'where':{'type':_0x10af5d,'resourceId':_0x56d0f7['id']}})['then'](function(){return _0xe73706;});})['then'](function(){_0x49295b[_0x86b9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x410aae,_0x40a31a){return function(_0x206eea){if(!_0x206eea){_0x410aae[_0x86b9('0x18')](0x194);}return _0x206eea;};}function handleError(_0x20ee75,_0x530f2b){_0x530f2b=_0x530f2b||0x1f4;return function(_0x45ec73){logger['error'](_0x45ec73[_0x86b9('0x28')]);if(_0x45ec73[_0x86b9('0x29')]){delete _0x45ec73[_0x86b9('0x29')];}_0x20ee75[_0x86b9('0x19')](_0x530f2b)[_0x86b9('0x2a')](_0x45ec73);};}exports['index']=function(_0x29396a,_0x4b5feb){var _0xd80aab={},_0x59a69e={},_0x3ceaa9={'count':0x0,'rows':[]};var _0x3742c4=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x4f2abd){return{'name':_0x4f2abd[_0x86b9('0x2b')],'type':_0x4f2abd[_0x86b9('0x2c')][_0x86b9('0x2d')]};});_0x59a69e[_0x86b9('0x2e')]=_[_0x86b9('0x2f')](_0x3742c4,_0x86b9('0x29'));_0x59a69e['query']=_[_0x86b9('0x30')](_0x29396a[_0x86b9('0x31')]);_0x59a69e[_0x86b9('0x32')]=_[_0x86b9('0x33')](_0x59a69e['model'],_0x59a69e['query']);_0xd80aab[_0x86b9('0x34')]=_[_0x86b9('0x33')](_0x59a69e[_0x86b9('0x2e')],qs[_0x86b9('0x35')](_0x29396a['query'][_0x86b9('0x35')]));_0xd80aab['attributes']=_0xd80aab['attributes'][_0x86b9('0x36')]?_0xd80aab['attributes']:_0x59a69e[_0x86b9('0x2e')];if(!_0x29396a['query'][_0x86b9('0x37')](_0x86b9('0x38'))){_0xd80aab[_0x86b9('0x1e')]=qs[_0x86b9('0x1e')](_0x29396a[_0x86b9('0x31')][_0x86b9('0x1e')]);_0xd80aab[_0x86b9('0x1d')]=qs[_0x86b9('0x1d')](_0x29396a['query'][_0x86b9('0x1d')]);}_0xd80aab[_0x86b9('0x39')]=qs[_0x86b9('0x3a')](_0x29396a[_0x86b9('0x31')][_0x86b9('0x3a')]);_0xd80aab[_0x86b9('0x3b')]=qs['filters'](_[_0x86b9('0x3c')](_0x29396a[_0x86b9('0x31')],_0x59a69e['filters']),_0x3742c4);if(_0x29396a[_0x86b9('0x31')]['filter']){_0xd80aab[_0x86b9('0x3b')]=_[_0x86b9('0x3d')](_0xd80aab[_0x86b9('0x3b')],{'$or':[{'key':{'$like':'%'+_0x29396a[_0x86b9('0x31')][_0x86b9('0x3e')]+'%'}},{'value':{'$like':'%'+_0x29396a['query'][_0x86b9('0x3e')]+'%'}}]});}_0xd80aab=_[_0x86b9('0x3d')]({},_0xd80aab,_0x29396a[_0x86b9('0x3f')]);var _0x2d62aa={'where':_0xd80aab[_0x86b9('0x3b')]};return db[_0x86b9('0x40')]['count'](_0x2d62aa)['then'](function(_0xcfc673){_0x3ceaa9[_0x86b9('0x1c')]=_0xcfc673;if(_0x29396a['query'][_0x86b9('0x41')]){_0xd80aab[_0x86b9('0x42')]=[{'all':!![]}];}return db[_0x86b9('0x40')][_0x86b9('0x43')](_0xd80aab);})[_0x86b9('0x25')](function(_0x549b9d){_0x3ceaa9[_0x86b9('0x44')]=_0x549b9d;return _0x3ceaa9;})[_0x86b9('0x25')](respondWithFilteredResult(_0x4b5feb,_0xd80aab))[_0x86b9('0x45')](handleError(_0x4b5feb,null));};exports['show']=function(_0x64f8ae,_0xa1fe18){var _0x4b152e={'raw':!![],'where':{'id':_0x64f8ae['params']['id']}},_0x1367d3={};_0x1367d3[_0x86b9('0x2e')]=_[_0x86b9('0x30')](db['CannedAnswer'][_0x86b9('0x46')]);_0x1367d3[_0x86b9('0x31')]=_[_0x86b9('0x30')](_0x64f8ae[_0x86b9('0x31')]);_0x1367d3[_0x86b9('0x32')]=_[_0x86b9('0x33')](_0x1367d3[_0x86b9('0x2e')],_0x1367d3[_0x86b9('0x31')]);_0x4b152e[_0x86b9('0x34')]=_[_0x86b9('0x33')](_0x1367d3[_0x86b9('0x2e')],qs[_0x86b9('0x35')](_0x64f8ae[_0x86b9('0x31')][_0x86b9('0x35')]));_0x4b152e['attributes']=_0x4b152e['attributes'][_0x86b9('0x36')]?_0x4b152e[_0x86b9('0x34')]:_0x1367d3[_0x86b9('0x2e')];if(_0x64f8ae[_0x86b9('0x31')]['includeAll']){_0x4b152e[_0x86b9('0x42')]=[{'all':!![]}];}_0x4b152e=_[_0x86b9('0x3d')]({},_0x4b152e,_0x64f8ae[_0x86b9('0x3f')]);return db['CannedAnswer']['find'](_0x4b152e)[_0x86b9('0x25')](handleEntityNotFound(_0xa1fe18,null))['then'](respondWithResult(_0xa1fe18,null))[_0x86b9('0x45')](handleError(_0xa1fe18,null));};exports[_0x86b9('0x47')]=function(_0x17747c,_0xfed46a){if(_0x17747c[_0x86b9('0x48')]['id']){delete _0x17747c[_0x86b9('0x48')]['id'];}return db[_0x86b9('0x40')]['find']({'where':{'id':_0x17747c[_0x86b9('0x49')]['id']}})[_0x86b9('0x25')](handleEntityNotFound(_0xfed46a,null))[_0x86b9('0x25')](saveUpdates(_0x17747c[_0x86b9('0x48')],null))['then'](respondWithResult(_0xfed46a,null))['catch'](handleError(_0xfed46a,null));};exports['destroy']=function(_0x471974,_0x1f6f08){return db[_0x86b9('0x40')][_0x86b9('0x4a')]({'where':{'id':_0x471974[_0x86b9('0x49')]['id']}})[_0x86b9('0x25')](handleEntityNotFound(_0x1f6f08,null))[_0x86b9('0x25')](removeEntity(_0x1f6f08,null))[_0x86b9('0x45')](handleError(_0x1f6f08,null));};exports[_0x86b9('0x4b')]=function(_0x10f819,_0x51d51e){var _0x5ee328={'key':_0x10f819[_0x86b9('0x48')][_0x86b9('0x2d')]};if(_0x10f819[_0x86b9('0x48')][_0x86b9('0x4c')]){_0x5ee328[_0x86b9('0x4c')]=_0x10f819['body'][_0x86b9('0x4c')];}else if(_0x10f819[_0x86b9('0x48')]['SmsAccountId']){_0x5ee328['SmsAccountId']=_0x10f819['body'][_0x86b9('0x4d')];}else if(_0x10f819['body'][_0x86b9('0x4e')]){_0x5ee328[_0x86b9('0x4e')]=_0x10f819[_0x86b9('0x48')][_0x86b9('0x4e')];}else if(_0x10f819[_0x86b9('0x48')][_0x86b9('0x4f')]){_0x5ee328['ChatWebsiteId']=_0x10f819[_0x86b9('0x48')][_0x86b9('0x4f')];}return db[_0x86b9('0x40')][_0x86b9('0x4a')]({'where':_0x5ee328})[_0x86b9('0x25')](function(_0x2d3880){if(_0x2d3880){throw new db[(_0x86b9('0x50'))][(_0x86b9('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x86b9('0x40')][_0x86b9('0x4b')](_0x10f819['body']);})[_0x86b9('0x25')](function(_0x60891){var _0x56bbd0=_0x10f819[_0x86b9('0x52')][_0x86b9('0x26')]({'plain':!![]});if(!_0x56bbd0)throw new Error(_0x86b9('0x53'));if(_0x56bbd0[_0x86b9('0x54')]===_0x86b9('0x52')){var _0x1392ba=_0x60891['get']({'plain':!![]});return db[_0x86b9('0x55')]['find']({'where':{'name':_0x86b9('0x56'),'userProfileId':_0x56bbd0[_0x86b9('0x57')]},'raw':!![]})[_0x86b9('0x25')](function(_0x5636d6){if(_0x5636d6&&_0x5636d6[_0x86b9('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x1392ba[_0x86b9('0x29')],'resourceId':_0x1392ba['id'],'type':_0x5636d6[_0x86b9('0x29')],'sectionId':_0x5636d6['id']},{})['then'](function(){return _0x60891;});}else{return _0x60891;}})[_0x86b9('0x45')](function(_0x2142a3){logger[_0x86b9('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2142a3);throw _0x2142a3;});}return _0x60891;})['then'](respondWithResult(_0x51d51e,0xc9))[_0x86b9('0x45')](handleError(_0x51d51e,null));};
\ No newline at end of file
+var _0x7d2d=['fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','body','find','params','create','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','CannedAnswers','error','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x51d3a8,_0x207ca2){var _0x53dbec=function(_0x312150){while(--_0x312150){_0x51d3a8['push'](_0x51d3a8['shift']());}};_0x53dbec(++_0x207ca2);}(_0x7d2d,0x7c));var _0xd7d2=function(_0x3047b4,_0x13059d){_0x3047b4=_0x3047b4-0x0;var _0x1ba017=_0x7d2d[_0x3047b4];return _0x1ba017;};'use strict';var emlformat=require(_0xd7d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd7d2('0x1'));var rp=require(_0xd7d2('0x2'));var moment=require(_0xd7d2('0x3'));var BPromise=require(_0xd7d2('0x4'));var Mustache=require(_0xd7d2('0x5'));var util=require(_0xd7d2('0x6'));var path=require(_0xd7d2('0x7'));var sox=require(_0xd7d2('0x8'));var csv=require(_0xd7d2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7d2('0xa'));var squel=require('squel');var crypto=require(_0xd7d2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd7d2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd7d2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd7d2('0xe'));var qs=require(_0xd7d2('0xf'));var as=require(_0xd7d2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd7d2('0x11'));var utils=require(_0xd7d2('0x12'));var config=require(_0xd7d2('0x13'));var licenseUtil=require(_0xd7d2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc631e9,_0x55f25e){_0x55f25e=_0x55f25e||0xcc;return function(_0x9c5077){if(_0x9c5077){return _0xc631e9[_0xd7d2('0x15')](_0x55f25e);}return _0xc631e9['status'](_0x55f25e)[_0xd7d2('0x16')]();};}function respondWithResult(_0x1a7f59,_0x44d976){_0x44d976=_0x44d976||0xc8;return function(_0x5df645){if(_0x5df645){return _0x1a7f59[_0xd7d2('0x17')](_0x44d976)[_0xd7d2('0x18')](_0x5df645);}};}function respondWithFilteredResult(_0x4f8701,_0x4a6d25){return function(_0x14d029){if(_0x14d029){var _0x29eb39=typeof _0x4a6d25[_0xd7d2('0x19')]===_0xd7d2('0x1a')&&typeof _0x4a6d25['limit']===_0xd7d2('0x1a');var _0x20fb9d=_0x14d029[_0xd7d2('0x1b')];var _0x207161=_0x29eb39?0x0:_0x4a6d25[_0xd7d2('0x19')];var _0x342cac=_0x29eb39?_0x14d029[_0xd7d2('0x1b')]:_0x4a6d25[_0xd7d2('0x19')]+_0x4a6d25[_0xd7d2('0x1c')];var _0xf9786b;if(_0x342cac>=_0x20fb9d){_0x342cac=_0x20fb9d;_0xf9786b=0xc8;}else{_0xf9786b=0xce;}_0x4f8701[_0xd7d2('0x17')](_0xf9786b);return _0x4f8701[_0xd7d2('0x1d')](_0xd7d2('0x1e'),_0x207161+'-'+_0x342cac+'/'+_0x20fb9d)[_0xd7d2('0x18')](_0x14d029);}return null;};}function patchUpdates(_0x41bfce){return function(_0x30b893){try{jsonpatch[_0xd7d2('0x1f')](_0x30b893,_0x41bfce,!![]);}catch(_0x316a9f){return BPromise[_0xd7d2('0x20')](_0x316a9f);}return _0x30b893['save']();};}function saveUpdates(_0xcd699f,_0x2e19d0){return function(_0x348fb5){if(_0x348fb5){return _0x348fb5[_0xd7d2('0x21')](_0xcd699f)[_0xd7d2('0x22')](function(_0x260e79){return _0x260e79;});}return null;};}function removeEntity(_0x4a50e6,_0x415c9b){return function(_0x394724){if(_0x394724){return _0x394724[_0xd7d2('0x23')]()[_0xd7d2('0x22')](function(){var _0x4703d9=_0x394724['get']({'plain':!![]});var _0x1c8b86=_0xd7d2('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1c8b86,'resourceId':_0x4703d9['id']}})[_0xd7d2('0x22')](function(){return _0x394724;});})[_0xd7d2('0x22')](function(){_0x4a50e6[_0xd7d2('0x17')](0xcc)[_0xd7d2('0x16')]();});}};}function handleEntityNotFound(_0x8aa2da,_0x2718af){return function(_0x3dda3e){if(!_0x3dda3e){_0x8aa2da['sendStatus'](0x194);}return _0x3dda3e;};}function handleError(_0x1b4933,_0x16446a){_0x16446a=_0x16446a||0x1f4;return function(_0x429bde){logger[_0xd7d2('0x25')](_0x429bde['stack']);if(_0x429bde[_0xd7d2('0x26')]){delete _0x429bde[_0xd7d2('0x26')];}_0x1b4933['status'](_0x16446a)[_0xd7d2('0x27')](_0x429bde);};}exports[_0xd7d2('0x28')]=function(_0x2c7eee,_0x4df677){var _0x2e828f={},_0x2a0594={},_0x503f0e={'count':0x0,'rows':[]};var _0x32dff5=_[_0xd7d2('0x29')](db[_0xd7d2('0x2a')][_0xd7d2('0x2b')],function(_0x440f63){return{'name':_0x440f63[_0xd7d2('0x2c')],'type':_0x440f63[_0xd7d2('0x2d')][_0xd7d2('0x2e')]};});_0x2a0594[_0xd7d2('0x2f')]=_[_0xd7d2('0x29')](_0x32dff5,'name');_0x2a0594[_0xd7d2('0x30')]=_['keys'](_0x2c7eee[_0xd7d2('0x30')]);_0x2a0594[_0xd7d2('0x31')]=_[_0xd7d2('0x32')](_0x2a0594[_0xd7d2('0x2f')],_0x2a0594[_0xd7d2('0x30')]);_0x2e828f['attributes']=_[_0xd7d2('0x32')](_0x2a0594['model'],qs[_0xd7d2('0x33')](_0x2c7eee[_0xd7d2('0x30')]['fields']));_0x2e828f[_0xd7d2('0x34')]=_0x2e828f[_0xd7d2('0x34')]['length']?_0x2e828f[_0xd7d2('0x34')]:_0x2a0594[_0xd7d2('0x2f')];if(!_0x2c7eee['query'][_0xd7d2('0x35')](_0xd7d2('0x36'))){_0x2e828f[_0xd7d2('0x1c')]=qs['limit'](_0x2c7eee['query'][_0xd7d2('0x1c')]);_0x2e828f[_0xd7d2('0x19')]=qs[_0xd7d2('0x19')](_0x2c7eee[_0xd7d2('0x30')]['offset']);}_0x2e828f[_0xd7d2('0x37')]=qs[_0xd7d2('0x38')](_0x2c7eee['query'][_0xd7d2('0x38')]);_0x2e828f[_0xd7d2('0x39')]=qs['filters'](_[_0xd7d2('0x3a')](_0x2c7eee[_0xd7d2('0x30')],_0x2a0594[_0xd7d2('0x31')]),_0x32dff5);if(_0x2c7eee['query'][_0xd7d2('0x3b')]){_0x2e828f[_0xd7d2('0x39')]=_['merge'](_0x2e828f[_0xd7d2('0x39')],{'$or':[{'key':{'$like':'%'+_0x2c7eee['query']['filter']+'%'}},{'value':{'$like':'%'+_0x2c7eee[_0xd7d2('0x30')][_0xd7d2('0x3b')]+'%'}}]});}_0x2e828f=_[_0xd7d2('0x3c')]({},_0x2e828f,_0x2c7eee[_0xd7d2('0x3d')]);var _0x25cbd3={'where':_0x2e828f[_0xd7d2('0x39')]};return db[_0xd7d2('0x2a')][_0xd7d2('0x1b')](_0x25cbd3)[_0xd7d2('0x22')](function(_0x2fcc23){_0x503f0e[_0xd7d2('0x1b')]=_0x2fcc23;if(_0x2c7eee[_0xd7d2('0x30')][_0xd7d2('0x3e')]){_0x2e828f[_0xd7d2('0x3f')]=[{'all':!![]}];}return db[_0xd7d2('0x2a')][_0xd7d2('0x40')](_0x2e828f);})[_0xd7d2('0x22')](function(_0x259855){_0x503f0e[_0xd7d2('0x41')]=_0x259855;return _0x503f0e;})[_0xd7d2('0x22')](respondWithFilteredResult(_0x4df677,_0x2e828f))[_0xd7d2('0x42')](handleError(_0x4df677,null));};exports[_0xd7d2('0x43')]=function(_0x5adc4b,_0x30f2d5){var _0x5721e6={'raw':!![],'where':{'id':_0x5adc4b['params']['id']}},_0x3115b9={};_0x3115b9['model']=_[_0xd7d2('0x44')](db[_0xd7d2('0x2a')][_0xd7d2('0x2b')]);_0x3115b9[_0xd7d2('0x30')]=_[_0xd7d2('0x44')](_0x5adc4b[_0xd7d2('0x30')]);_0x3115b9[_0xd7d2('0x31')]=_[_0xd7d2('0x32')](_0x3115b9[_0xd7d2('0x2f')],_0x3115b9[_0xd7d2('0x30')]);_0x5721e6[_0xd7d2('0x34')]=_['intersection'](_0x3115b9[_0xd7d2('0x2f')],qs['fields'](_0x5adc4b[_0xd7d2('0x30')][_0xd7d2('0x33')]));_0x5721e6[_0xd7d2('0x34')]=_0x5721e6[_0xd7d2('0x34')]['length']?_0x5721e6['attributes']:_0x3115b9[_0xd7d2('0x2f')];if(_0x5adc4b[_0xd7d2('0x30')]['includeAll']){_0x5721e6[_0xd7d2('0x3f')]=[{'all':!![]}];}_0x5721e6=_[_0xd7d2('0x3c')]({},_0x5721e6,_0x5adc4b[_0xd7d2('0x3d')]);return db['CannedAnswer']['find'](_0x5721e6)[_0xd7d2('0x22')](handleEntityNotFound(_0x30f2d5,null))[_0xd7d2('0x22')](respondWithResult(_0x30f2d5,null))['catch'](handleError(_0x30f2d5,null));};exports['update']=function(_0x31fe3f,_0x3b344c){if(_0x31fe3f['body']['id']){delete _0x31fe3f[_0xd7d2('0x45')]['id'];}return db[_0xd7d2('0x2a')][_0xd7d2('0x46')]({'where':{'id':_0x31fe3f[_0xd7d2('0x47')]['id']}})[_0xd7d2('0x22')](handleEntityNotFound(_0x3b344c,null))[_0xd7d2('0x22')](saveUpdates(_0x31fe3f[_0xd7d2('0x45')],null))['then'](respondWithResult(_0x3b344c,null))[_0xd7d2('0x42')](handleError(_0x3b344c,null));};exports[_0xd7d2('0x23')]=function(_0x57085a,_0x20ecd7){return db[_0xd7d2('0x2a')][_0xd7d2('0x46')]({'where':{'id':_0x57085a['params']['id']}})[_0xd7d2('0x22')](handleEntityNotFound(_0x20ecd7,null))[_0xd7d2('0x22')](removeEntity(_0x20ecd7,null))['catch'](handleError(_0x20ecd7,null));};exports[_0xd7d2('0x48')]=function(_0x400851,_0x4e9693){var _0x35dc01={'key':_0x400851['body'][_0xd7d2('0x2e')]};if(_0x400851[_0xd7d2('0x45')]['MailAccountId']){_0x35dc01['MailAccountId']=_0x400851[_0xd7d2('0x45')]['MailAccountId'];}else if(_0x400851['body']['SmsAccountId']){_0x35dc01[_0xd7d2('0x49')]=_0x400851[_0xd7d2('0x45')][_0xd7d2('0x49')];}else if(_0x400851['body'][_0xd7d2('0x4a')]){_0x35dc01[_0xd7d2('0x4a')]=_0x400851['body'][_0xd7d2('0x4a')];}else if(_0x400851['body']['ChatWebsiteId']){_0x35dc01[_0xd7d2('0x4b')]=_0x400851[_0xd7d2('0x45')][_0xd7d2('0x4b')];}return db[_0xd7d2('0x2a')]['find']({'where':_0x35dc01})[_0xd7d2('0x22')](function(_0x4bbc09){if(_0x4bbc09){throw new db[(_0xd7d2('0x4c'))][(_0xd7d2('0x4d'))](_0xd7d2('0x4e'));}return db[_0xd7d2('0x2a')][_0xd7d2('0x48')](_0x400851[_0xd7d2('0x45')]);})['then'](function(_0x57c42a){var _0x5aad93=_0x400851['user']['get']({'plain':!![]});if(!_0x5aad93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aad93['role']===_0xd7d2('0x4f')){var _0x15e954=_0x57c42a['get']({'plain':!![]});return db[_0xd7d2('0x50')]['find']({'where':{'name':_0xd7d2('0x24'),'userProfileId':_0x5aad93['userProfileId']},'raw':!![]})[_0xd7d2('0x22')](function(_0x2ee5ce){if(_0x2ee5ce&&_0x2ee5ce[_0xd7d2('0x51')]===0x0){return db[_0xd7d2('0x52')][_0xd7d2('0x48')]({'name':_0x15e954[_0xd7d2('0x26')],'resourceId':_0x15e954['id'],'type':_0x2ee5ce[_0xd7d2('0x26')],'sectionId':_0x2ee5ce['id']},{})[_0xd7d2('0x22')](function(){return _0x57c42a;});}else{return _0x57c42a;}})[_0xd7d2('0x42')](function(_0x562d15){logger[_0xd7d2('0x25')](_0xd7d2('0x53'),_0x562d15);throw _0x562d15;});}return _0x57c42a;})['then'](respondWithResult(_0x4e9693,0xc9))[_0xd7d2('0x42')](handleError(_0x4e9693,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index b1e7d7c..94e13ed 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 _0x3354=['utf8mb4','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x5ca7dd,_0x31cff4){var _0x44aa57=function(_0x106f69){while(--_0x106f69){_0x5ca7dd['push'](_0x5ca7dd['shift']());}};_0x44aa57(++_0x31cff4);}(_0x3354,0x189));var _0x4335=function(_0x3297a3,_0x220dc1){_0x3297a3=_0x3297a3-0x0;var _0x5aa51f=_0x3354[_0x3297a3];return _0x5aa51f;};'use strict';var _=require(_0x4335('0x0'));var util=require(_0x4335('0x1'));var logger=require('../../config/logger')(_0x4335('0x2'));var moment=require(_0x4335('0x3'));var BPromise=require(_0x4335('0x4'));var rp=require(_0x4335('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4335('0x6'));var config=require(_0x4335('0x7'));var attributes=require(_0x4335('0x8'));module[_0x4335('0x9')]=function(_0x1facac,_0x46ec7b){return _0x1facac[_0x4335('0xa')](_0x4335('0xb'),attributes,{'tableName':_0x4335('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4335('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3fc3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CannedAnswer','tools_canned_answers'];(function(_0x3bf56d,_0xa0b1f1){var _0x518c54=function(_0x4ec245){while(--_0x4ec245){_0x3bf56d['push'](_0x3bf56d['shift']());}};_0x518c54(++_0xa0b1f1);}(_0x3fc3,0x110));var _0x33fc=function(_0x1c65ab,_0x31bd2f){_0x1c65ab=_0x1c65ab-0x0;var _0x2eaafb=_0x3fc3[_0x1c65ab];return _0x2eaafb;};'use strict';var _=require(_0x33fc('0x0'));var util=require(_0x33fc('0x1'));var logger=require(_0x33fc('0x2'))(_0x33fc('0x3'));var moment=require(_0x33fc('0x4'));var BPromise=require(_0x33fc('0x5'));var rp=require(_0x33fc('0x6'));var fs=require('fs');var path=require(_0x33fc('0x7'));var rimraf=require(_0x33fc('0x8'));var config=require(_0x33fc('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0x33fc('0xa')]=function(_0x491a41,_0x5a4627){return _0x491a41['define'](_0x33fc('0xb'),attributes,{'tableName':_0x33fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x33fc('0xd'),'collate':_0x33fc('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 40db582..63c784b 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 _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x271ec9,_0xefbaf){var _0x2b153a=function(_0x3c5e3c){while(--_0x3c5e3c){_0x271ec9['push'](_0x271ec9['shift']());}};_0x2b153a(++_0xefbaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x4adbd8,_0x655861){var _0x22b303=function(_0x22af66){while(--_0x22af66){_0x4adbd8['push'](_0x4adbd8['shift']());}};_0x22b303(++_0x655861);}(_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 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/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 1c04a61..6c958ac 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 _0xcc49=['show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id'];(function(_0x3e4924,_0x3c25b0){var _0x724fe5=function(_0x29aeba){while(--_0x29aeba){_0x3e4924['push'](_0x3e4924['shift']());}};_0x724fe5(++_0x3c25b0);}(_0xcc49,0x84));var _0x9cc4=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0xcc49[_0x5aef17];return _0x43f9d0;};'use strict';var multer=require(_0x9cc4('0x0'));var util=require(_0x9cc4('0x1'));var path=require(_0x9cc4('0x2'));var timeout=require(_0x9cc4('0x3'));var express=require(_0x9cc4('0x4'));var router=express['Router']();var fs_extra=require(_0x9cc4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9cc4('0x6'));var controller=require(_0x9cc4('0x7'));router[_0x9cc4('0x8')]('/',auth[_0x9cc4('0x9')](),controller[_0x9cc4('0xa')]);router[_0x9cc4('0x8')](_0x9cc4('0xb'),auth[_0x9cc4('0x9')](),controller[_0x9cc4('0xc')]);router[_0x9cc4('0xd')]('/',auth[_0x9cc4('0x9')](),controller[_0x9cc4('0xe')]);router[_0x9cc4('0xf')](_0x9cc4('0xb'),auth[_0x9cc4('0x9')](),controller[_0x9cc4('0x10')]);router['delete'](_0x9cc4('0xb'),auth[_0x9cc4('0x9')](),controller[_0x9cc4('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x420c=['index','isAuthenticated','show','create','/:id','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x1fff7d,_0xe8b9a){var _0x2996e0=function(_0x223f54){while(--_0x223f54){_0x1fff7d['push'](_0x1fff7d['shift']());}};_0x2996e0(++_0xe8b9a);}(_0x420c,0xd7));var _0xc420=function(_0xc5837d,_0x27cda1){_0xc5837d=_0xc5837d-0x0;var _0x59ccd4=_0x420c[_0xc5837d];return _0x59ccd4;};'use strict';var multer=require('multer');var util=require(_0xc420('0x0'));var path=require(_0xc420('0x1'));var timeout=require(_0xc420('0x2'));var express=require('express');var router=express[_0xc420('0x3')]();var fs_extra=require(_0xc420('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc420('0x5'));var config=require(_0xc420('0x6'));var controller=require(_0xc420('0x7'));router[_0xc420('0x8')]('/',auth['isAuthenticated'](),controller[_0xc420('0x9')]);router[_0xc420('0x8')]('/:id',auth[_0xc420('0xa')](),controller[_0xc420('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc420('0xc')]);router['put'](_0xc420('0xd'),auth[_0xc420('0xa')](),controller[_0xc420('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc420('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index a011708..c70a624 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 _0xfe57=['INTEGER','sequelize','exports','STRING'];(function(_0x3f6e26,_0x811a34){var _0x474345=function(_0x4a0cbe){while(--_0x4a0cbe){_0x3f6e26['push'](_0x3f6e26['shift']());}};_0x474345(++_0x811a34);}(_0xfe57,0x195));var _0x7fe5=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xfe57[_0x146a97];return _0x259d5c;};'use strict';var Sequelize=require(_0x7fe5('0x0'));module[_0x7fe5('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7fe5('0x2')]},'src':{'type':Sequelize[_0x7fe5('0x2')]},'dst':{'type':Sequelize[_0x7fe5('0x2')]},'dcontext':{'type':Sequelize[_0x7fe5('0x2')]},'channel':{'type':Sequelize[_0x7fe5('0x2')]},'dstchannel':{'type':Sequelize[_0x7fe5('0x2')]},'lastapp':{'type':Sequelize[_0x7fe5('0x2')]},'lastdata':{'type':Sequelize[_0x7fe5('0x2')]},'duration':{'type':Sequelize[_0x7fe5('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7fe5('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7fe5('0x2')]},'amaflags':{'type':Sequelize[_0x7fe5('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7fe5('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7fe5('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x7fe5('0x2')]},'peeraccount':{'type':Sequelize[_0x7fe5('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe5b5=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2a85f2,_0x458881){var _0x86e5a9=function(_0x44eb18){while(--_0x44eb18){_0x2a85f2['push'](_0x2a85f2['shift']());}};_0x86e5a9(++_0x458881);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xe5b5[_0x3e7e96];return _0x13f6f0;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'calldate':{'type':Sequelize[_0x5e5b('0x2')],'allowNull':![],'defaultValue':_0x5e5b('0x3')},'clid':{'type':Sequelize[_0x5e5b('0x4')]},'src':{'type':Sequelize[_0x5e5b('0x4')]},'dst':{'type':Sequelize[_0x5e5b('0x4')]},'dcontext':{'type':Sequelize[_0x5e5b('0x4')]},'channel':{'type':Sequelize[_0x5e5b('0x4')]},'dstchannel':{'type':Sequelize[_0x5e5b('0x4')]},'lastapp':{'type':Sequelize[_0x5e5b('0x4')]},'lastdata':{'type':Sequelize[_0x5e5b('0x4')]},'duration':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5e5b('0x4')]},'amaflags':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5e5b('0x4')]},'userfield':{'type':Sequelize[_0x5e5b('0x4')]},'uniqueid':{'type':Sequelize[_0x5e5b('0x4')]},'linkedid':{'type':Sequelize[_0x5e5b('0x4')]},'sequence':{'type':Sequelize[_0x5e5b('0x4')]},'peeraccount':{'type':Sequelize[_0x5e5b('0x4')]},'type':{'type':Sequelize[_0x5e5b('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 59eb17b..37736bc 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 _0xd6d2=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','Cdr','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x13b4c9,_0x146baf){var _0x15a9a0=function(_0xbfe8f6){while(--_0xbfe8f6){_0x13b4c9['push'](_0x13b4c9['shift']());}};_0x15a9a0(++_0x146baf);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x374acb,_0x52f395){_0x374acb=_0x374acb-0x0;var _0x58c788=_0xd6d2[_0x374acb];return _0x58c788;};'use strict';var emlformat=require(_0x2d6d('0x0'));var rimraf=require(_0x2d6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d6d('0x2'));var rp=require(_0x2d6d('0x3'));var moment=require('moment');var BPromise=require(_0x2d6d('0x4'));var Mustache=require('mustache');var util=require(_0x2d6d('0x5'));var path=require(_0x2d6d('0x6'));var sox=require(_0x2d6d('0x7'));var csv=require('to-csv');var ejs=require(_0x2d6d('0x8'));var fs=require('fs');var fs_extra=require(_0x2d6d('0x9'));var _=require(_0x2d6d('0xa'));var squel=require(_0x2d6d('0xb'));var crypto=require(_0x2d6d('0xc'));var jsforce=require(_0x2d6d('0xd'));var deskjs=require(_0x2d6d('0xe'));var toCsv=require(_0x2d6d('0xf'));var querystring=require(_0x2d6d('0x10'));var Papa=require(_0x2d6d('0x11'));var Redis=require(_0x2d6d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2d6d('0x13'));var as=require(_0x2d6d('0x14'));var hardwareService=require(_0x2d6d('0x15'));var logger=require(_0x2d6d('0x16'))(_0x2d6d('0x17'));var utils=require('../../config/utils');var config=require(_0x2d6d('0x18'));var licenseUtil=require(_0x2d6d('0x19'));var db=require(_0x2d6d('0x1a'))['db'];function respondWithStatusCode(_0x2ad9fc,_0x5c4bf6){_0x5c4bf6=_0x5c4bf6||0xcc;return function(_0x5ef174){if(_0x5ef174){return _0x2ad9fc[_0x2d6d('0x1b')](_0x5c4bf6);}return _0x2ad9fc[_0x2d6d('0x1c')](_0x5c4bf6)[_0x2d6d('0x1d')]();};}function respondWithResult(_0x3528de,_0x58bd29){_0x58bd29=_0x58bd29||0xc8;return function(_0x1ec6aa){if(_0x1ec6aa){return _0x3528de[_0x2d6d('0x1c')](_0x58bd29)['json'](_0x1ec6aa);}};}function respondWithFilteredResult(_0x586085,_0x370096){return function(_0x17340f){if(_0x17340f){var _0x109b49=typeof _0x370096['offset']===_0x2d6d('0x1e')&&typeof _0x370096['limit']==='undefined';var _0x4c3092=_0x17340f[_0x2d6d('0x1f')];var _0x4179f2=_0x109b49?0x0:_0x370096[_0x2d6d('0x20')];var _0x3c527e=_0x109b49?_0x17340f[_0x2d6d('0x1f')]:_0x370096[_0x2d6d('0x20')]+_0x370096[_0x2d6d('0x21')];var _0xa2c4a7;if(_0x3c527e>=_0x4c3092){_0x3c527e=_0x4c3092;_0xa2c4a7=0xc8;}else{_0xa2c4a7=0xce;}_0x586085[_0x2d6d('0x1c')](_0xa2c4a7);return _0x586085['set'](_0x2d6d('0x22'),_0x4179f2+'-'+_0x3c527e+'/'+_0x4c3092)[_0x2d6d('0x23')](_0x17340f);}return null;};}function patchUpdates(_0x5b0c61){return function(_0x227e44){try{jsonpatch[_0x2d6d('0x24')](_0x227e44,_0x5b0c61,!![]);}catch(_0x15cb80){return BPromise[_0x2d6d('0x25')](_0x15cb80);}return _0x227e44[_0x2d6d('0x26')]();};}function saveUpdates(_0x59234a,_0x4aaa62){return function(_0x42c2f2){if(_0x42c2f2){return _0x42c2f2[_0x2d6d('0x27')](_0x59234a)[_0x2d6d('0x28')](function(_0x585b54){return _0x585b54;});}return null;};}function removeEntity(_0x47eb0e,_0x3ae8ad){return function(_0x4e7ec8){if(_0x4e7ec8){return _0x4e7ec8['destroy']()['then'](function(){_0x47eb0e[_0x2d6d('0x1c')](0xcc)[_0x2d6d('0x1d')]();});}};}function handleEntityNotFound(_0x3da83d,_0x3f89dd){return function(_0x3e5a92){if(!_0x3e5a92){_0x3da83d['sendStatus'](0x194);}return _0x3e5a92;};}function handleError(_0x16634d,_0x1b4964){_0x1b4964=_0x1b4964||0x1f4;return function(_0x455e71){logger[_0x2d6d('0x29')](_0x455e71[_0x2d6d('0x2a')]);if(_0x455e71[_0x2d6d('0x2b')]){delete _0x455e71[_0x2d6d('0x2b')];}_0x16634d[_0x2d6d('0x1c')](_0x1b4964)[_0x2d6d('0x2c')](_0x455e71);};}exports['index']=function(_0x1016e1,_0x26d299){var _0x2e7b32={},_0x34d485={},_0x486963={'count':0x0,'rows':[]};var _0x317bde=_['map'](db[_0x2d6d('0x2d')]['rawAttributes'],function(_0x58bfc7){return{'name':_0x58bfc7[_0x2d6d('0x2e')],'type':_0x58bfc7['type'][_0x2d6d('0x2f')]};});_0x34d485[_0x2d6d('0x30')]=_['map'](_0x317bde,_0x2d6d('0x2b'));_0x34d485['query']=_[_0x2d6d('0x31')](_0x1016e1[_0x2d6d('0x32')]);_0x34d485[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x34d485[_0x2d6d('0x30')],_0x34d485[_0x2d6d('0x32')]);_0x2e7b32[_0x2d6d('0x35')]=_[_0x2d6d('0x34')](_0x34d485['model'],qs[_0x2d6d('0x36')](_0x1016e1[_0x2d6d('0x32')]['fields']));_0x2e7b32[_0x2d6d('0x35')]=_0x2e7b32[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x2e7b32[_0x2d6d('0x35')]:_0x34d485[_0x2d6d('0x30')];if(!_0x1016e1['query']['hasOwnProperty']('nolimit')){_0x2e7b32[_0x2d6d('0x21')]=qs[_0x2d6d('0x21')](_0x1016e1[_0x2d6d('0x32')]['limit']);_0x2e7b32[_0x2d6d('0x20')]=qs[_0x2d6d('0x20')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x20')]);}_0x2e7b32['order']=qs[_0x2d6d('0x38')](_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x38')]);_0x2e7b32[_0x2d6d('0x39')]=qs[_0x2d6d('0x33')](_[_0x2d6d('0x3a')](_0x1016e1[_0x2d6d('0x32')],_0x34d485['filters']),_0x317bde);if(_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x3b')]){_0x2e7b32[_0x2d6d('0x39')]=_[_0x2d6d('0x3c')](_0x2e7b32[_0x2d6d('0x39')],{'$or':_['map'](_0x317bde,function(_0x1cad57){if(_0x1cad57[_0x2d6d('0x3d')]!==_0x2d6d('0x3e')){var _0x4616df={};_0x4616df[_0x1cad57[_0x2d6d('0x2b')]]={'$like':'%'+_0x1016e1[_0x2d6d('0x32')][_0x2d6d('0x3b')]+'%'};return _0x4616df;}})});}_0x2e7b32=_[_0x2d6d('0x3c')]({},_0x2e7b32,_0x1016e1[_0x2d6d('0x3f')]);var _0x38cce8={'where':_0x2e7b32[_0x2d6d('0x39')]};return db[_0x2d6d('0x2d')][_0x2d6d('0x1f')](_0x38cce8)[_0x2d6d('0x28')](function(_0x34fc23){_0x486963[_0x2d6d('0x1f')]=_0x34fc23;if(_0x1016e1[_0x2d6d('0x32')]['includeAll']){_0x2e7b32[_0x2d6d('0x40')]=[{'all':!![]}];}return db[_0x2d6d('0x2d')][_0x2d6d('0x41')](_0x2e7b32);})[_0x2d6d('0x28')](function(_0x246d6e){_0x486963['rows']=_0x246d6e;return _0x486963;})[_0x2d6d('0x28')](respondWithFilteredResult(_0x26d299,_0x2e7b32))[_0x2d6d('0x42')](handleError(_0x26d299,null));};exports[_0x2d6d('0x43')]=function(_0x41ab2e,_0x543b4b){var _0x3b62b1={'raw':!![],'where':{'id':_0x41ab2e[_0x2d6d('0x44')]['id']}},_0x7f76ad={};_0x7f76ad[_0x2d6d('0x30')]=_[_0x2d6d('0x31')](db['Cdr'][_0x2d6d('0x45')]);_0x7f76ad[_0x2d6d('0x32')]=_['keys'](_0x41ab2e[_0x2d6d('0x32')]);_0x7f76ad[_0x2d6d('0x33')]=_[_0x2d6d('0x34')](_0x7f76ad['model'],_0x7f76ad[_0x2d6d('0x32')]);_0x3b62b1[_0x2d6d('0x35')]=_['intersection'](_0x7f76ad['model'],qs['fields'](_0x41ab2e[_0x2d6d('0x32')][_0x2d6d('0x36')]));_0x3b62b1['attributes']=_0x3b62b1[_0x2d6d('0x35')][_0x2d6d('0x37')]?_0x3b62b1[_0x2d6d('0x35')]:_0x7f76ad[_0x2d6d('0x30')];if(_0x41ab2e['query'][_0x2d6d('0x46')]){_0x3b62b1[_0x2d6d('0x40')]=[{'all':!![]}];}_0x3b62b1=_['merge']({},_0x3b62b1,_0x41ab2e[_0x2d6d('0x3f')]);return db[_0x2d6d('0x2d')][_0x2d6d('0x47')](_0x3b62b1)[_0x2d6d('0x28')](handleEntityNotFound(_0x543b4b,null))[_0x2d6d('0x28')](respondWithResult(_0x543b4b,null))[_0x2d6d('0x42')](handleError(_0x543b4b,null));};exports[_0x2d6d('0x48')]=function(_0x5ac5e9,_0xe6b038){return db[_0x2d6d('0x2d')][_0x2d6d('0x48')](_0x5ac5e9['body'],{})['then'](respondWithResult(_0xe6b038,0xc9))[_0x2d6d('0x42')](handleError(_0xe6b038,null));};exports[_0x2d6d('0x27')]=function(_0x422198,_0x4e5203){if(_0x422198[_0x2d6d('0x49')]['id']){delete _0x422198[_0x2d6d('0x49')]['id'];}return db['Cdr'][_0x2d6d('0x47')]({'where':{'id':_0x422198[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x4e5203,null))[_0x2d6d('0x28')](saveUpdates(_0x422198[_0x2d6d('0x49')],null))[_0x2d6d('0x28')](respondWithResult(_0x4e5203,null))[_0x2d6d('0x42')](handleError(_0x4e5203,null));};exports[_0x2d6d('0x4a')]=function(_0x42c125,_0x1ca9a2){return db['Cdr'][_0x2d6d('0x47')]({'where':{'id':_0x42c125[_0x2d6d('0x44')]['id']}})[_0x2d6d('0x28')](handleEntityNotFound(_0x1ca9a2,null))['then'](removeEntity(_0x1ca9a2,null))[_0x2d6d('0x42')](handleError(_0x1ca9a2,null));};exports[_0x2d6d('0x4b')]=function(_0x3738b3,_0x2dbcdc){return db[_0x2d6d('0x2d')][_0x2d6d('0x4b')]()[_0x2d6d('0x28')](respondWithResult(_0x2dbcdc,null))['catch'](handleError(_0x2dbcdc,null));};
\ No newline at end of file
+var _0x4873=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','rawAttributes','type','key','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Cdr','catch','show','model','fields','includeAll','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4873,0x1df));var _0x3487=function(_0xef2e27,_0x5ce104){_0xef2e27=_0xef2e27-0x0;var _0x1afb9b=_0x4873[_0xef2e27];return _0x1afb9b;};'use strict';var emlformat=require(_0x3487('0x0'));var rimraf=require(_0x3487('0x1'));var zipdir=require(_0x3487('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3487('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3487('0x4'));var util=require(_0x3487('0x5'));var path=require(_0x3487('0x6'));var sox=require(_0x3487('0x7'));var csv=require(_0x3487('0x8'));var ejs=require(_0x3487('0x9'));var fs=require('fs');var fs_extra=require(_0x3487('0xa'));var _=require(_0x3487('0xb'));var squel=require('squel');var crypto=require(_0x3487('0xc'));var jsforce=require(_0x3487('0xd'));var deskjs=require(_0x3487('0xe'));var toCsv=require(_0x3487('0x8'));var querystring=require(_0x3487('0xf'));var Papa=require('papaparse');var Redis=require(_0x3487('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3487('0x11'));var as=require(_0x3487('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3487('0x13'));var utils=require(_0x3487('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3487('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x557d64,_0x395774){_0x395774=_0x395774||0xcc;return function(_0x1be2e0){if(_0x1be2e0){return _0x557d64[_0x3487('0x16')](_0x395774);}return _0x557d64[_0x3487('0x17')](_0x395774)[_0x3487('0x18')]();};}function respondWithResult(_0x1e468b,_0x4fbd63){_0x4fbd63=_0x4fbd63||0xc8;return function(_0x23ce3b){if(_0x23ce3b){return _0x1e468b[_0x3487('0x17')](_0x4fbd63)[_0x3487('0x19')](_0x23ce3b);}};}function respondWithFilteredResult(_0x4f79f0,_0x156e80){return function(_0x1b19c4){if(_0x1b19c4){var _0x38c0c1=typeof _0x156e80[_0x3487('0x1a')]===_0x3487('0x1b')&&typeof _0x156e80[_0x3487('0x1c')]===_0x3487('0x1b');var _0x32ecde=_0x1b19c4[_0x3487('0x1d')];var _0x2fa630=_0x38c0c1?0x0:_0x156e80[_0x3487('0x1a')];var _0x41795b=_0x38c0c1?_0x1b19c4[_0x3487('0x1d')]:_0x156e80[_0x3487('0x1a')]+_0x156e80['limit'];var _0x320349;if(_0x41795b>=_0x32ecde){_0x41795b=_0x32ecde;_0x320349=0xc8;}else{_0x320349=0xce;}_0x4f79f0['status'](_0x320349);return _0x4f79f0[_0x3487('0x1e')](_0x3487('0x1f'),_0x2fa630+'-'+_0x41795b+'/'+_0x32ecde)[_0x3487('0x19')](_0x1b19c4);}return null;};}function patchUpdates(_0x29546f){return function(_0xd788f8){try{jsonpatch[_0x3487('0x20')](_0xd788f8,_0x29546f,!![]);}catch(_0x479354){return BPromise[_0x3487('0x21')](_0x479354);}return _0xd788f8[_0x3487('0x22')]();};}function saveUpdates(_0x28f8f7,_0x97013d){return function(_0x11437c){if(_0x11437c){return _0x11437c[_0x3487('0x23')](_0x28f8f7)['then'](function(_0x384792){return _0x384792;});}return null;};}function removeEntity(_0x3e63e8,_0x25ed9f){return function(_0x482551){if(_0x482551){return _0x482551['destroy']()[_0x3487('0x24')](function(){_0x3e63e8[_0x3487('0x17')](0xcc)[_0x3487('0x18')]();});}};}function handleEntityNotFound(_0x3a9d76,_0x4c6882){return function(_0x79a183){if(!_0x79a183){_0x3a9d76[_0x3487('0x16')](0x194);}return _0x79a183;};}function handleError(_0x5484f6,_0x1e7126){_0x1e7126=_0x1e7126||0x1f4;return function(_0x3fb245){logger['error'](_0x3fb245['stack']);if(_0x3fb245[_0x3487('0x25')]){delete _0x3fb245[_0x3487('0x25')];}_0x5484f6[_0x3487('0x17')](_0x1e7126)[_0x3487('0x26')](_0x3fb245);};}exports[_0x3487('0x27')]=function(_0x1a02d6,_0x1c5bd6){var _0x38af4a={},_0x25e123={},_0x4dada9={'count':0x0,'rows':[]};var _0x24532a=_['map'](db['Cdr'][_0x3487('0x28')],function(_0x56ee54){return{'name':_0x56ee54['fieldName'],'type':_0x56ee54[_0x3487('0x29')][_0x3487('0x2a')]};});_0x25e123['model']=_['map'](_0x24532a,_0x3487('0x25'));_0x25e123[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x1a02d6['query']);_0x25e123[_0x3487('0x2d')]=_['intersection'](_0x25e123['model'],_0x25e123['query']);_0x38af4a[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x25e123['model'],qs['fields'](_0x1a02d6[_0x3487('0x2b')]['fields']));_0x38af4a['attributes']=_0x38af4a[_0x3487('0x2e')][_0x3487('0x30')]?_0x38af4a[_0x3487('0x2e')]:_0x25e123['model'];if(!_0x1a02d6[_0x3487('0x2b')][_0x3487('0x31')](_0x3487('0x32'))){_0x38af4a[_0x3487('0x1c')]=qs['limit'](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1c')]);_0x38af4a['offset']=qs[_0x3487('0x1a')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1a')]);}_0x38af4a[_0x3487('0x33')]=qs[_0x3487('0x34')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x34')]);_0x38af4a[_0x3487('0x35')]=qs[_0x3487('0x2d')](_['pick'](_0x1a02d6[_0x3487('0x2b')],_0x25e123[_0x3487('0x2d')]),_0x24532a);if(_0x1a02d6['query']['filter']){_0x38af4a[_0x3487('0x35')]=_[_0x3487('0x36')](_0x38af4a[_0x3487('0x35')],{'$or':_['map'](_0x24532a,function(_0x58006c){if(_0x58006c['type']!==_0x3487('0x37')){var _0x268674={};_0x268674[_0x58006c['name']]={'$like':'%'+_0x1a02d6[_0x3487('0x2b')][_0x3487('0x38')]+'%'};return _0x268674;}})});}_0x38af4a=_[_0x3487('0x36')]({},_0x38af4a,_0x1a02d6[_0x3487('0x39')]);var _0x106393={'where':_0x38af4a[_0x3487('0x35')]};return db[_0x3487('0x3a')][_0x3487('0x1d')](_0x106393)[_0x3487('0x24')](function(_0x565cb2){_0x4dada9[_0x3487('0x1d')]=_0x565cb2;if(_0x1a02d6[_0x3487('0x2b')]['includeAll']){_0x38af4a['include']=[{'all':!![]}];}return db[_0x3487('0x3a')]['findAll'](_0x38af4a);})['then'](function(_0x3eb68c){_0x4dada9['rows']=_0x3eb68c;return _0x4dada9;})['then'](respondWithFilteredResult(_0x1c5bd6,_0x38af4a))[_0x3487('0x3b')](handleError(_0x1c5bd6,null));};exports[_0x3487('0x3c')]=function(_0x58a4c8,_0x51b69c){var _0xc04317={'raw':!![],'where':{'id':_0x58a4c8['params']['id']}},_0x8cd06f={};_0x8cd06f[_0x3487('0x3d')]=_[_0x3487('0x2c')](db['Cdr'][_0x3487('0x28')]);_0x8cd06f[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x58a4c8['query']);_0x8cd06f[_0x3487('0x2d')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],_0x8cd06f[_0x3487('0x2b')]);_0xc04317[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],qs[_0x3487('0x3e')](_0x58a4c8['query'][_0x3487('0x3e')]));_0xc04317[_0x3487('0x2e')]=_0xc04317[_0x3487('0x2e')][_0x3487('0x30')]?_0xc04317[_0x3487('0x2e')]:_0x8cd06f[_0x3487('0x3d')];if(_0x58a4c8[_0x3487('0x2b')][_0x3487('0x3f')]){_0xc04317['include']=[{'all':!![]}];}_0xc04317=_['merge']({},_0xc04317,_0x58a4c8[_0x3487('0x39')]);return db[_0x3487('0x3a')][_0x3487('0x40')](_0xc04317)[_0x3487('0x24')](handleEntityNotFound(_0x51b69c,null))['then'](respondWithResult(_0x51b69c,null))['catch'](handleError(_0x51b69c,null));};exports[_0x3487('0x41')]=function(_0x122456,_0x3fe91f){return db[_0x3487('0x3a')][_0x3487('0x41')](_0x122456[_0x3487('0x42')],{})[_0x3487('0x24')](respondWithResult(_0x3fe91f,0xc9))[_0x3487('0x3b')](handleError(_0x3fe91f,null));};exports['update']=function(_0x585a44,_0x320351){if(_0x585a44[_0x3487('0x42')]['id']){delete _0x585a44['body']['id'];}return db[_0x3487('0x3a')]['find']({'where':{'id':_0x585a44['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x320351,null))[_0x3487('0x24')](saveUpdates(_0x585a44['body'],null))[_0x3487('0x24')](respondWithResult(_0x320351,null))[_0x3487('0x3b')](handleError(_0x320351,null));};exports[_0x3487('0x43')]=function(_0x4ab5f8,_0x761f95){return db[_0x3487('0x3a')][_0x3487('0x40')]({'where':{'id':_0x4ab5f8[_0x3487('0x44')]['id']}})['then'](handleEntityNotFound(_0x761f95,null))[_0x3487('0x24')](removeEntity(_0x761f95,null))[_0x3487('0x3b')](handleError(_0x761f95,null));};exports[_0x3487('0x45')]=function(_0x33e826,_0x11125d){return db[_0x3487('0x3a')][_0x3487('0x45')]()['then'](respondWithResult(_0x11125d,null))[_0x3487('0x3b')](handleError(_0x11125d,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index f2e0cc1..69c3508 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x1eb400,_0x3c9483){var _0x320d9f=function(_0x56597a){while(--_0x56597a){_0x1eb400['push'](_0x1eb400['shift']());}};_0x320d9f(++_0x3c9483);}(_0x7a54,0x106));var _0x47a5=function(_0x24df01,_0x9a49e3){_0x24df01=_0x24df01-0x0;var _0x2aed6b=_0x7a54[_0x24df01];return _0x2aed6b;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3e704c,_0x4b1eb4){var _0x41c075=function(_0x5f2140){while(--_0x5f2140){_0x3e704c['push'](_0x3e704c['shift']());}};_0x41c075(++_0x4b1eb4);}(_0x7a54,0x106));var _0x47a5=function(_0x3b062a,_0x5b324b){_0x3b062a=_0x3b062a-0x0;var _0x31c9d2=_0x7a54[_0x3b062a];return _0x31c9d2;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 2a1699e..1b9554b 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 _0x5a26=['jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x118e90,_0x45b88b){var _0x105d8c=function(_0x238ad6){while(--_0x238ad6){_0x118e90['push'](_0x118e90['shift']());}};_0x105d8c(++_0x45b88b);}(_0x5a26,0x1f2));var _0x65a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x65a2('0x0'));var util=require('util');var moment=require(_0x65a2('0x1'));var BPromise=require('bluebird');var rs=require(_0x65a2('0x2'));var fs=require('fs');var Redis=require(_0x65a2('0x3'));var db=require(_0x65a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65a2('0x5'))(_0x65a2('0x6'));var config=require(_0x65a2('0x7'));var jayson=require(_0x65a2('0x8'));var client=jayson[_0x65a2('0x9')][_0x65a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e9020,_0x537664,_0x54f2ed){return new BPromise(function(_0x510b87,_0x6d18b){return client['request'](_0x4e9020,_0x54f2ed)[_0x65a2('0xb')](function(_0x23dc19){logger[_0x65a2('0xc')](_0x65a2('0xd'),_0x537664,_0x65a2('0xe'));logger['debug'](_0x65a2('0xf'),_0x537664,_0x65a2('0xe'),JSON[_0x65a2('0x10')](_0x23dc19));if(_0x23dc19[_0x65a2('0x11')]){if(_0x23dc19['error'][_0x65a2('0x12')]===0x1f4){logger[_0x65a2('0x11')](_0x65a2('0xd'),_0x537664,_0x23dc19[_0x65a2('0x11')][_0x65a2('0x13')]);return _0x6d18b(_0x23dc19[_0x65a2('0x11')][_0x65a2('0x13')]);}logger[_0x65a2('0x11')](_0x65a2('0xd'),_0x537664,_0x23dc19[_0x65a2('0x11')]['message']);return _0x510b87(_0x23dc19['error']['message']);}else{logger['info'](_0x65a2('0xd'),_0x537664,_0x65a2('0xe'));_0x510b87(_0x23dc19[_0x65a2('0x14')][_0x65a2('0x13')]);}})[_0x65a2('0x15')](function(_0x125bdc){logger['error'](_0x65a2('0xd'),_0x537664,_0x125bdc);_0x6d18b(_0x125bdc);});});}
\ No newline at end of file
+var _0xfd8e=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x40b3de,_0x327d8b){var _0x269f49=function(_0x56d430){while(--_0x56d430){_0x40b3de['push'](_0x40b3de['shift']());}};_0x269f49(++_0x327d8b);}(_0xfd8e,0x127));var _0xefd8=function(_0x46e6e3,_0x59e170){_0x46e6e3=_0x46e6e3-0x0;var _0x348f17=_0xfd8e[_0x46e6e3];return _0x348f17;};'use strict';var _=require(_0xefd8('0x0'));var util=require(_0xefd8('0x1'));var moment=require('moment');var BPromise=require(_0xefd8('0x2'));var rs=require(_0xefd8('0x3'));var fs=require('fs');var Redis=require(_0xefd8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefd8('0x5'))(_0xefd8('0x6'));var config=require('../../config/environment');var jayson=require(_0xefd8('0x7'));var client=jayson[_0xefd8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461d6f,_0x2a57e3,_0x1fc457){return new BPromise(function(_0x407312,_0x656657){return client[_0xefd8('0x9')](_0x461d6f,_0x1fc457)[_0xefd8('0xa')](function(_0x1a85b0){logger[_0xefd8('0xb')](_0xefd8('0xc'),_0x2a57e3,_0xefd8('0xd'));logger['debug'](_0xefd8('0xe'),_0x2a57e3,_0xefd8('0xd'),JSON[_0xefd8('0xf')](_0x1a85b0));if(_0x1a85b0[_0xefd8('0x10')]){if(_0x1a85b0[_0xefd8('0x10')]['code']===0x1f4){logger[_0xefd8('0x10')](_0xefd8('0xc'),_0x2a57e3,_0x1a85b0['error'][_0xefd8('0x11')]);return _0x656657(_0x1a85b0[_0xefd8('0x10')]['message']);}logger['error'](_0xefd8('0xc'),_0x2a57e3,_0x1a85b0[_0xefd8('0x10')]['message']);return _0x407312(_0x1a85b0[_0xefd8('0x10')][_0xefd8('0x11')]);}else{logger[_0xefd8('0xb')](_0xefd8('0xc'),_0x2a57e3,_0xefd8('0xd'));_0x407312(_0x1a85b0['result'][_0xefd8('0x11')]);}})[_0xefd8('0x12')](function(_0x530042){logger[_0xefd8('0x10')](_0xefd8('0xc'),_0x2a57e3,_0x530042);_0x656657(_0x530042);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0324ead..7492974 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x271d02,_0x5cd222){var _0x14112d=function(_0x43c775){while(--_0x43c775){_0x271d02['push'](_0x271d02['shift']());}};_0x14112d(++_0x5cd222);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x32d351,_0x44eb47){var _0xcde9fa=function(_0x24a26d){while(--_0x24a26d){_0x32d351['push'](_0x32d351['shift']());}};_0xcde9fa(++_0x44eb47);}(_0xb10b,0x12a));var _0xbb10=function(_0xfadccd,_0x290136){_0xfadccd=_0xfadccd-0x0;var _0x482ac4=_0xb10b[_0xfadccd];return _0x482ac4;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index b4bd554..8cf696f 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 _0x6e87=['TEXT','exports','INTEGER','STRING','noop'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6e87,0x7e));var _0x76e8=function(_0x52c8f8,_0x5b141b){_0x52c8f8=_0x52c8f8-0x0;var _0x3193ba=_0x6e87[_0x52c8f8];return _0x3193ba;};'use strict';var Sequelize=require('sequelize');module[_0x76e8('0x0')]={'priority':{'type':Sequelize[_0x76e8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x76e8('0x2')],'allowNull':![],'defaultValue':_0x76e8('0x3')},'appdata':{'type':Sequelize[_0x76e8('0x4')]()},'description':{'type':Sequelize[_0x76e8('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xe4a3=['noop','TEXT','*,*,*,*','INTEGER','STRING'];(function(_0x54dfa3,_0x519df9){var _0x302fb9=function(_0x35c204){while(--_0x35c204){_0x54dfa3['push'](_0x54dfa3['shift']());}};_0x302fb9(++_0x519df9);}(_0xe4a3,0x107));var _0x3e4a=function(_0x938050,_0x5591e9){_0x938050=_0x938050-0x0;var _0x43da16=_0xe4a3[_0x938050];return _0x43da16;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x3e4a('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x3e4a('0x1')],'allowNull':![],'defaultValue':_0x3e4a('0x2')},'appdata':{'type':Sequelize[_0x3e4a('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3e4a('0x1')],'defaultValue':_0x3e4a('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index ce0d984..c2f94ae 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 _0x3013=['body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','apply','then','destroy','error','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','catch','update'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0x3013,0xea));var _0x3301=function(_0x12aaa9,_0x71ed9c){_0x12aaa9=_0x12aaa9-0x0;var _0x6da6d8=_0x3013[_0x12aaa9];return _0x6da6d8;};'use strict';var emlformat=require(_0x3301('0x0'));var rimraf=require(_0x3301('0x1'));var zipdir=require(_0x3301('0x2'));var jsonpatch=require(_0x3301('0x3'));var rp=require('request-promise');var moment=require(_0x3301('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3301('0x5'));var util=require(_0x3301('0x6'));var path=require(_0x3301('0x7'));var sox=require(_0x3301('0x8'));var csv=require('to-csv');var ejs=require(_0x3301('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3301('0xa'));var squel=require(_0x3301('0xb'));var crypto=require(_0x3301('0xc'));var jsforce=require(_0x3301('0xd'));var deskjs=require(_0x3301('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3301('0xf'));var Papa=require(_0x3301('0x10'));var Redis=require(_0x3301('0x11'));var authService=require(_0x3301('0x12'));var qs=require(_0x3301('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3301('0x14'));var logger=require(_0x3301('0x15'))(_0x3301('0x16'));var utils=require(_0x3301('0x17'));var config=require(_0x3301('0x18'));var licenseUtil=require(_0x3301('0x19'));var db=require(_0x3301('0x1a'))['db'];function respondWithStatusCode(_0x2c8df9,_0x427c22){_0x427c22=_0x427c22||0xcc;return function(_0x40dad9){if(_0x40dad9){return _0x2c8df9[_0x3301('0x1b')](_0x427c22);}return _0x2c8df9[_0x3301('0x1c')](_0x427c22)[_0x3301('0x1d')]();};}function respondWithResult(_0x3dcf1d,_0x52a56c){_0x52a56c=_0x52a56c||0xc8;return function(_0x3d182e){if(_0x3d182e){return _0x3dcf1d[_0x3301('0x1c')](_0x52a56c)['json'](_0x3d182e);}};}function respondWithFilteredResult(_0x49bc8e,_0x8f280d){return function(_0x225e94){if(_0x225e94){var _0x5e7d09=typeof _0x8f280d[_0x3301('0x1e')]===_0x3301('0x1f')&&typeof _0x8f280d['limit']===_0x3301('0x1f');var _0x6e88ec=_0x225e94[_0x3301('0x20')];var _0x4b3eea=_0x5e7d09?0x0:_0x8f280d[_0x3301('0x1e')];var _0xd3d931=_0x5e7d09?_0x225e94[_0x3301('0x20')]:_0x8f280d[_0x3301('0x1e')]+_0x8f280d[_0x3301('0x21')];var _0x2a15b9;if(_0xd3d931>=_0x6e88ec){_0xd3d931=_0x6e88ec;_0x2a15b9=0xc8;}else{_0x2a15b9=0xce;}_0x49bc8e['status'](_0x2a15b9);return _0x49bc8e['set']('Content-Range',_0x4b3eea+'-'+_0xd3d931+'/'+_0x6e88ec)['json'](_0x225e94);}return null;};}function patchUpdates(_0x23dcc8){return function(_0x2b2005){try{jsonpatch[_0x3301('0x22')](_0x2b2005,_0x23dcc8,!![]);}catch(_0x2490d7){return BPromise['reject'](_0x2490d7);}return _0x2b2005['save']();};}function saveUpdates(_0x4e65c9,_0x3ebe89){return function(_0x54c291){if(_0x54c291){return _0x54c291['update'](_0x4e65c9)[_0x3301('0x23')](function(_0x21edb4){return _0x21edb4;});}return null;};}function removeEntity(_0x258d28,_0xef67c4){return function(_0x1d89b2){if(_0x1d89b2){return _0x1d89b2[_0x3301('0x24')]()['then'](function(){_0x258d28[_0x3301('0x1c')](0xcc)[_0x3301('0x1d')]();});}};}function handleEntityNotFound(_0x13fb21,_0x39d766){return function(_0x54ec21){if(!_0x54ec21){_0x13fb21[_0x3301('0x1b')](0x194);}return _0x54ec21;};}function handleError(_0x2f821,_0x150f73){_0x150f73=_0x150f73||0x1f4;return function(_0x2febe1){logger[_0x3301('0x25')](_0x2febe1['stack']);if(_0x2febe1['name']){delete _0x2febe1['name'];}_0x2f821['status'](_0x150f73)[_0x3301('0x26')](_0x2febe1);};}exports[_0x3301('0x27')]=function(_0x1684a9,_0x48f661){var _0x31d585={'raw':!![],'where':{'id':_0x1684a9[_0x3301('0x28')]['id']}},_0x3d1d80={};_0x3d1d80[_0x3301('0x29')]=_[_0x3301('0x2a')](db[_0x3301('0x2b')][_0x3301('0x2c')]);_0x3d1d80[_0x3301('0x2d')]=_['keys'](_0x1684a9['query']);_0x3d1d80[_0x3301('0x2e')]=_[_0x3301('0x2f')](_0x3d1d80[_0x3301('0x29')],_0x3d1d80[_0x3301('0x2d')]);_0x31d585[_0x3301('0x30')]=_[_0x3301('0x2f')](_0x3d1d80[_0x3301('0x29')],qs['fields'](_0x1684a9['query'][_0x3301('0x31')]));_0x31d585[_0x3301('0x30')]=_0x31d585[_0x3301('0x30')][_0x3301('0x32')]?_0x31d585[_0x3301('0x30')]:_0x3d1d80[_0x3301('0x29')];if(_0x1684a9[_0x3301('0x2d')][_0x3301('0x33')]){_0x31d585[_0x3301('0x34')]=[{'all':!![]}];}_0x31d585=_['merge']({},_0x31d585,_0x1684a9[_0x3301('0x35')]);return db['ChatApplication']['find'](_0x31d585)[_0x3301('0x23')](handleEntityNotFound(_0x48f661,null))[_0x3301('0x23')](respondWithResult(_0x48f661,null))[_0x3301('0x36')](handleError(_0x48f661,null));};exports[_0x3301('0x37')]=function(_0x115b72,_0x137f48){if(_0x115b72[_0x3301('0x38')]['id']){delete _0x115b72['body']['id'];}return db[_0x3301('0x2b')][_0x3301('0x39')]({'where':{'id':_0x115b72[_0x3301('0x28')]['id']}})[_0x3301('0x23')](handleEntityNotFound(_0x137f48,null))[_0x3301('0x23')](saveUpdates(_0x115b72[_0x3301('0x38')],null))[_0x3301('0x23')](respondWithResult(_0x137f48,null))['catch'](handleError(_0x137f48,null));};exports[_0x3301('0x24')]=function(_0x37b3a3,_0x563392){return db['ChatApplication'][_0x3301('0x39')]({'where':{'id':_0x37b3a3[_0x3301('0x28')]['id']}})['then'](handleEntityNotFound(_0x563392,null))[_0x3301('0x23')](removeEntity(_0x563392,null))['catch'](handleError(_0x563392,null));};
\ No newline at end of file
+var _0x58e5=['sox','ejs','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','stack','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x51fd4e,_0x4bf5fd){var _0x20beed=function(_0x4bd9f7){while(--_0x4bd9f7){_0x51fd4e['push'](_0x51fd4e['shift']());}};_0x20beed(++_0x4bf5fd);}(_0x58e5,0xd1));var _0x558e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x58e5[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x558e('0x0'));var rimraf=require(_0x558e('0x1'));var zipdir=require(_0x558e('0x2'));var jsonpatch=require(_0x558e('0x3'));var rp=require(_0x558e('0x4'));var moment=require(_0x558e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x558e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x558e('0x7'));var csv=require('to-csv');var ejs=require(_0x558e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x558e('0x9'));var squel=require(_0x558e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x558e('0xb'));var Redis=require(_0x558e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x558e('0xd'));var as=require(_0x558e('0xe'));var hardwareService=require(_0x558e('0xf'));var logger=require(_0x558e('0x10'))('api');var utils=require(_0x558e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x558e('0x12'));var db=require(_0x558e('0x13'))['db'];function respondWithStatusCode(_0x1328b5,_0x3bd154){_0x3bd154=_0x3bd154||0xcc;return function(_0x4a0889){if(_0x4a0889){return _0x1328b5[_0x558e('0x14')](_0x3bd154);}return _0x1328b5[_0x558e('0x15')](_0x3bd154)['end']();};}function respondWithResult(_0x288e2f,_0x9933cd){_0x9933cd=_0x9933cd||0xc8;return function(_0x4a6f57){if(_0x4a6f57){return _0x288e2f[_0x558e('0x15')](_0x9933cd)['json'](_0x4a6f57);}};}function respondWithFilteredResult(_0x134bdf,_0x13d3b1){return function(_0x5d61ab){if(_0x5d61ab){var _0x21552c=typeof _0x13d3b1[_0x558e('0x16')]===_0x558e('0x17')&&typeof _0x13d3b1[_0x558e('0x18')]==='undefined';var _0x2225d5=_0x5d61ab[_0x558e('0x19')];var _0x84da47=_0x21552c?0x0:_0x13d3b1[_0x558e('0x16')];var _0xb955b2=_0x21552c?_0x5d61ab[_0x558e('0x19')]:_0x13d3b1[_0x558e('0x16')]+_0x13d3b1['limit'];var _0x4afcfe;if(_0xb955b2>=_0x2225d5){_0xb955b2=_0x2225d5;_0x4afcfe=0xc8;}else{_0x4afcfe=0xce;}_0x134bdf[_0x558e('0x15')](_0x4afcfe);return _0x134bdf[_0x558e('0x1a')](_0x558e('0x1b'),_0x84da47+'-'+_0xb955b2+'/'+_0x2225d5)[_0x558e('0x1c')](_0x5d61ab);}return null;};}function patchUpdates(_0x208288){return function(_0xc046be){try{jsonpatch[_0x558e('0x1d')](_0xc046be,_0x208288,!![]);}catch(_0x2e3279){return BPromise[_0x558e('0x1e')](_0x2e3279);}return _0xc046be[_0x558e('0x1f')]();};}function saveUpdates(_0x4c402d,_0x39b61d){return function(_0x10d323){if(_0x10d323){return _0x10d323['update'](_0x4c402d)['then'](function(_0x448485){return _0x448485;});}return null;};}function removeEntity(_0x59a349,_0x87fb47){return function(_0x44b7fe){if(_0x44b7fe){return _0x44b7fe['destroy']()[_0x558e('0x20')](function(){_0x59a349[_0x558e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26874d,_0x4e9182){return function(_0x29caf3){if(!_0x29caf3){_0x26874d[_0x558e('0x14')](0x194);}return _0x29caf3;};}function handleError(_0x2ce831,_0x391da8){_0x391da8=_0x391da8||0x1f4;return function(_0x489f65){logger['error'](_0x489f65[_0x558e('0x21')]);if(_0x489f65['name']){delete _0x489f65['name'];}_0x2ce831[_0x558e('0x15')](_0x391da8)[_0x558e('0x22')](_0x489f65);};}exports[_0x558e('0x23')]=function(_0x17bf74,_0x42fb72){var _0x4deb75={'raw':!![],'where':{'id':_0x17bf74[_0x558e('0x24')]['id']}},_0x2e0166={};_0x2e0166[_0x558e('0x25')]=_['keys'](db[_0x558e('0x26')][_0x558e('0x27')]);_0x2e0166[_0x558e('0x28')]=_[_0x558e('0x29')](_0x17bf74[_0x558e('0x28')]);_0x2e0166[_0x558e('0x2a')]=_[_0x558e('0x2b')](_0x2e0166[_0x558e('0x25')],_0x2e0166[_0x558e('0x28')]);_0x4deb75[_0x558e('0x2c')]=_['intersection'](_0x2e0166[_0x558e('0x25')],qs[_0x558e('0x2d')](_0x17bf74[_0x558e('0x28')][_0x558e('0x2d')]));_0x4deb75['attributes']=_0x4deb75['attributes'][_0x558e('0x2e')]?_0x4deb75[_0x558e('0x2c')]:_0x2e0166[_0x558e('0x25')];if(_0x17bf74[_0x558e('0x28')]['includeAll']){_0x4deb75['include']=[{'all':!![]}];}_0x4deb75=_[_0x558e('0x2f')]({},_0x4deb75,_0x17bf74[_0x558e('0x30')]);return db[_0x558e('0x26')][_0x558e('0x31')](_0x4deb75)[_0x558e('0x20')](handleEntityNotFound(_0x42fb72,null))[_0x558e('0x20')](respondWithResult(_0x42fb72,null))[_0x558e('0x32')](handleError(_0x42fb72,null));};exports[_0x558e('0x33')]=function(_0x2225db,_0xdedffa){if(_0x2225db[_0x558e('0x34')]['id']){delete _0x2225db['body']['id'];}return db[_0x558e('0x26')][_0x558e('0x31')]({'where':{'id':_0x2225db['params']['id']}})['then'](handleEntityNotFound(_0xdedffa,null))['then'](saveUpdates(_0x2225db[_0x558e('0x34')],null))[_0x558e('0x20')](respondWithResult(_0xdedffa,null))['catch'](handleError(_0xdedffa,null));};exports[_0x558e('0x35')]=function(_0x2b555f,_0x449d74){return db[_0x558e('0x26')]['find']({'where':{'id':_0x2b555f[_0x558e('0x24')]['id']}})[_0x558e('0x20')](handleEntityNotFound(_0x449d74,null))['then'](removeEntity(_0x449d74,null))['catch'](handleError(_0x449d74,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d32a895..5b71f10 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 _0xbdfd=['bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x4f6e7f,_0x22d8b1){var _0x3d919b=function(_0xad4db3){while(--_0xad4db3){_0x4f6e7f['push'](_0x4f6e7f['shift']());}};_0x3d919b(++_0x22d8b1);}(_0xbdfd,0x135));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xdbdf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbdf('0x1'));var moment=require(_0xdbdf('0x2'));var BPromise=require(_0xdbdf('0x3'));var rp=require(_0xdbdf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdbdf('0x5'));var config=require(_0xdbdf('0x6'));var attributes=require('./chatApplication.attributes');module[_0xdbdf('0x7')]=function(_0xa743ff,_0x484034){return _0xa743ff[_0xdbdf('0x8')](_0xdbdf('0x9'),attributes,{'tableName':_0xdbdf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdbdf('0xb'),'collate':_0xdbdf('0xc')});};
\ No newline at end of file
+var _0xa4ba=['../../config/logger','api','moment','request-promise','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','util'];(function(_0x5eb236,_0x333496){var _0x795156=function(_0x57f85f){while(--_0x57f85f){_0x5eb236['push'](_0x5eb236['shift']());}};_0x795156(++_0x333496);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa4ba[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var moment=require(_0xaa4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa4b('0x5'));var attributes=require(_0xaa4b('0x6'));module[_0xaa4b('0x7')]=function(_0x146035,_0x4809a9){return _0x146035[_0xaa4b('0x8')]('ChatApplication',attributes,{'tableName':_0xaa4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 670ed91..ccb6a72 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 _0x36fc=['stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x389722,_0x2cb8ac){var _0x2c41f5=function(_0x471ba9){while(--_0x471ba9){_0x389722['push'](_0x389722['shift']());}};_0x2c41f5(++_0x2cb8ac);}(_0x36fc,0x6e));var _0xc36f=function(_0x1bd332,_0x536135){_0x1bd332=_0x1bd332-0x0;var _0x3227cd=_0x36fc[_0x1bd332];return _0x3227cd;};'use strict';var _=require('lodash');var util=require(_0xc36f('0x0'));var moment=require(_0xc36f('0x1'));var BPromise=require(_0xc36f('0x2'));var rs=require(_0xc36f('0x3'));var fs=require('fs');var Redis=require(_0xc36f('0x4'));var db=require(_0xc36f('0x5'))['db'];var utils=require(_0xc36f('0x6'));var logger=require(_0xc36f('0x7'))(_0xc36f('0x8'));var config=require(_0xc36f('0x9'));var jayson=require(_0xc36f('0xa'));var client=jayson['client'][_0xc36f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x306d78,_0x4cd1f3,_0x5bc3d0){return new BPromise(function(_0x561393,_0x57937c){return client['request'](_0x306d78,_0x5bc3d0)[_0xc36f('0xc')](function(_0x27bbb5){logger['info'](_0xc36f('0xd'),_0x4cd1f3,_0xc36f('0xe'));logger['debug'](_0xc36f('0xf'),_0x4cd1f3,'request\x20sent',JSON[_0xc36f('0x10')](_0x27bbb5));if(_0x27bbb5[_0xc36f('0x11')]){if(_0x27bbb5['error'][_0xc36f('0x12')]===0x1f4){logger[_0xc36f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x4cd1f3,_0x27bbb5[_0xc36f('0x11')]['message']);return _0x57937c(_0x27bbb5['error'][_0xc36f('0x13')]);}logger[_0xc36f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x4cd1f3,_0x27bbb5[_0xc36f('0x11')][_0xc36f('0x13')]);return _0x561393(_0x27bbb5[_0xc36f('0x11')][_0xc36f('0x13')]);}else{logger['info'](_0xc36f('0xd'),_0x4cd1f3,_0xc36f('0xe'));_0x561393(_0x27bbb5[_0xc36f('0x14')]['message']);}})['catch'](function(_0x3911c6){logger[_0xc36f('0x11')](_0xc36f('0xd'),_0x4cd1f3,_0x3911c6);_0x57937c(_0x3911c6);});});}
\ No newline at end of file
+var _0xff46=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','moment'];(function(_0x35085c,_0x292579){var _0x36d2b2=function(_0x2b2068){while(--_0x2b2068){_0x35085c['push'](_0x35085c['shift']());}};_0x36d2b2(++_0x292579);}(_0xff46,0x70));var _0x6ff4=function(_0x2e1e77,_0x1bc176){_0x2e1e77=_0x2e1e77-0x0;var _0x5403b6=_0xff46[_0x2e1e77];return _0x5403b6;};'use strict';var _=require(_0x6ff4('0x0'));var util=require('util');var moment=require(_0x6ff4('0x1'));var BPromise=require(_0x6ff4('0x2'));var rs=require(_0x6ff4('0x3'));var fs=require('fs');var Redis=require(_0x6ff4('0x4'));var db=require(_0x6ff4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6ff4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6ff4('0x7')][_0x6ff4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fbe2e,_0x816b11,_0x290e71){return new BPromise(function(_0x351247,_0x102239){return client[_0x6ff4('0x9')](_0x2fbe2e,_0x290e71)['then'](function(_0x5b4fdb){logger[_0x6ff4('0xa')]('ChatApplication,\x20%s,\x20%s',_0x816b11,_0x6ff4('0xb'));logger[_0x6ff4('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x816b11,_0x6ff4('0xb'),JSON['stringify'](_0x5b4fdb));if(_0x5b4fdb[_0x6ff4('0xd')]){if(_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xe')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x816b11,_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xf')]);return _0x102239(_0x5b4fdb[_0x6ff4('0xd')]['message']);}logger[_0x6ff4('0xd')](_0x6ff4('0x10'),_0x816b11,_0x5b4fdb['error']['message']);return _0x351247(_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xf')]);}else{logger[_0x6ff4('0xa')](_0x6ff4('0x10'),_0x816b11,'request\x20sent');_0x351247(_0x5b4fdb[_0x6ff4('0x11')][_0x6ff4('0xf')]);}})[_0x6ff4('0x12')](function(_0x38bf93){logger[_0x6ff4('0xd')](_0x6ff4('0x10'),_0x816b11,_0x38bf93);_0x102239(_0x38bf93);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 46fd3f9..4dd745f 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 _0xcbe4=['delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./chatApplication.controller','/:id','put'];(function(_0x16f117,_0x1a0bf9){var _0x169b4d=function(_0x562314){while(--_0x562314){_0x16f117['push'](_0x16f117['shift']());}};_0x169b4d(++_0x1a0bf9);}(_0xcbe4,0x153));var _0x4cbe=function(_0x1ab479,_0x2a2ed6){_0x1ab479=_0x1ab479-0x0;var _0x43aa53=_0xcbe4[_0x1ab479];return _0x43aa53;};'use strict';var multer=require(_0x4cbe('0x0'));var util=require(_0x4cbe('0x1'));var path=require(_0x4cbe('0x2'));var timeout=require(_0x4cbe('0x3'));var express=require(_0x4cbe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4cbe('0x5'));var config=require('../../config/environment');var controller=require(_0x4cbe('0x6'));router['get'](_0x4cbe('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x4cbe('0x8')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4cbe('0x9')](_0x4cbe('0x7'),auth[_0x4cbe('0xa')](),controller['destroy']);module[_0x4cbe('0xb')]=router;
\ No newline at end of file
+var _0x26b1=['update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','get','/:id','isAuthenticated','show','put'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x26b1,0x13f));var _0x126b=function(_0x3f38f3,_0x22cad7){_0x3f38f3=_0x3f38f3-0x0;var _0x2e88c1=_0x26b1[_0x3f38f3];return _0x2e88c1;};'use strict';var multer=require(_0x126b('0x0'));var util=require(_0x126b('0x1'));var path=require(_0x126b('0x2'));var timeout=require('connect-timeout');var express=require(_0x126b('0x3'));var router=express[_0x126b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x126b('0x5'));var controller=require('./chatApplication.controller');router[_0x126b('0x6')](_0x126b('0x7'),auth[_0x126b('0x8')](),controller[_0x126b('0x9')]);router[_0x126b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x126b('0xb')]);router[_0x126b('0xc')](_0x126b('0x7'),auth[_0x126b('0x8')](),controller[_0x126b('0xd')]);module[_0x126b('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4f3fc49..245562c 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 _0xe63f=['BOOLEAN','sequelize','STRING'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0xe63f,0x163));var _0xfe63=function(_0xdc6179,_0x228c8d){_0xdc6179=_0xdc6179-0x0;var _0x3c24c4=_0xe63f[_0xdc6179];return _0x3c24c4;};'use strict';var Sequelize=require(_0xfe63('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe63('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfe63('0x1')]},'write':{'type':Sequelize[_0xfe63('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3f3d=['STRING','BOOLEAN','sequelize'];(function(_0x3b8363,_0x17bc8){var _0x4d8289=function(_0x520c1d){while(--_0x520c1d){_0x3b8363['push'](_0x3b8363['shift']());}};_0x4d8289(++_0x17bc8);}(_0x3f3d,0xd4));var _0xd3f3=function(_0x160148,_0x5c0639){_0x160148=_0x160148-0x0;var _0x5d4a2c=_0x3f3d[_0x160148];return _0x5d4a2c;};'use strict';var Sequelize=require(_0xd3f3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3f3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd3f3('0x1')]},'write':{'type':Sequelize[_0xd3f3('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 096f0fb..98b3eb1 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 _0xb6be=['destroy','error','name','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','ChatGroup','include','findAll','rows','show','includeAll','find','catch','create','body','update','params','describe','toInteger','addMembers','ids','omit','getMembers','User','order','removeMembers','addMessage','getMessages','findOne','$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','offset','limit','count','status','set','Content-Range','apply','reject','save','then'];(function(_0x5efa14,_0x470ee0){var _0x580121=function(_0xa354b4){while(--_0xa354b4){_0x5efa14['push'](_0x5efa14['shift']());}};_0x580121(++_0x470ee0);}(_0xb6be,0x141));var _0xeb6b=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0xb6be[_0x4bd06e];return _0x85ebb;};'use strict';var emlformat=require(_0xeb6b('0x0'));var rimraf=require(_0xeb6b('0x1'));var zipdir=require(_0xeb6b('0x2'));var jsonpatch=require(_0xeb6b('0x3'));var rp=require(_0xeb6b('0x4'));var moment=require('moment');var BPromise=require(_0xeb6b('0x5'));var Mustache=require(_0xeb6b('0x6'));var util=require(_0xeb6b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeb6b('0x8'));var ejs=require(_0xeb6b('0x9'));var fs=require('fs');var fs_extra=require(_0xeb6b('0xa'));var _=require(_0xeb6b('0xb'));var squel=require(_0xeb6b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeb6b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeb6b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeb6b('0xf'));var as=require(_0xeb6b('0x10'));var hardwareService=require(_0xeb6b('0x11'));var logger=require(_0xeb6b('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeb6b('0x13'));var db=require(_0xeb6b('0x14'))['db'];config[_0xeb6b('0x15')]=_[_0xeb6b('0x16')](config[_0xeb6b('0x15')],{'host':_0xeb6b('0x17'),'port':0x18eb});var socket=require(_0xeb6b('0x18'))(new Redis(config[_0xeb6b('0x15')]));require(_0xeb6b('0x19'))[_0xeb6b('0x1a')](socket);function respondWithStatusCode(_0x1c3ce0,_0x49d031){_0x49d031=_0x49d031||0xcc;return function(_0x4ddaea){if(_0x4ddaea){return _0x1c3ce0[_0xeb6b('0x1b')](_0x49d031);}return _0x1c3ce0['status'](_0x49d031)[_0xeb6b('0x1c')]();};}function respondWithResult(_0x4f8ba6,_0x40a23e){_0x40a23e=_0x40a23e||0xc8;return function(_0x373854){if(_0x373854){return _0x4f8ba6['status'](_0x40a23e)['json'](_0x373854);}};}function respondWithFilteredResult(_0x286b18,_0x5cb770){return function(_0x425c90){if(_0x425c90){var _0x58cfb6=typeof _0x5cb770[_0xeb6b('0x1d')]==='undefined'&&typeof _0x5cb770[_0xeb6b('0x1e')]==='undefined';var _0x258703=_0x425c90['count'];var _0x5a2100=_0x58cfb6?0x0:_0x5cb770['offset'];var _0x34ac6f=_0x58cfb6?_0x425c90[_0xeb6b('0x1f')]:_0x5cb770[_0xeb6b('0x1d')]+_0x5cb770[_0xeb6b('0x1e')];var _0x34343f;if(_0x34ac6f>=_0x258703){_0x34ac6f=_0x258703;_0x34343f=0xc8;}else{_0x34343f=0xce;}_0x286b18[_0xeb6b('0x20')](_0x34343f);return _0x286b18[_0xeb6b('0x21')](_0xeb6b('0x22'),_0x5a2100+'-'+_0x34ac6f+'/'+_0x258703)['json'](_0x425c90);}return null;};}function patchUpdates(_0x1c63a8){return function(_0x4ca340){try{jsonpatch[_0xeb6b('0x23')](_0x4ca340,_0x1c63a8,!![]);}catch(_0x20e021){return BPromise[_0xeb6b('0x24')](_0x20e021);}return _0x4ca340[_0xeb6b('0x25')]();};}function saveUpdates(_0x35c988,_0xf9d3d){return function(_0x2ca1e0){if(_0x2ca1e0){return _0x2ca1e0['update'](_0x35c988)[_0xeb6b('0x26')](function(_0x50f60a){return _0x50f60a;});}return null;};}function removeEntity(_0x54ba40,_0x2cc6f3){return function(_0x1bb3e8){if(_0x1bb3e8){return _0x1bb3e8[_0xeb6b('0x27')]()[_0xeb6b('0x26')](function(){_0x54ba40[_0xeb6b('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f4c57,_0x441d32){return function(_0x20ceb2){if(!_0x20ceb2){_0x4f4c57[_0xeb6b('0x1b')](0x194);}return _0x20ceb2;};}function handleError(_0x48e55e,_0x296247){_0x296247=_0x296247||0x1f4;return function(_0x5caf77){logger[_0xeb6b('0x28')](_0x5caf77['stack']);if(_0x5caf77[_0xeb6b('0x29')]){delete _0x5caf77['name'];}_0x48e55e[_0xeb6b('0x20')](_0x296247)['send'](_0x5caf77);};}exports['index']=function(_0xc16b66,_0x1b39d5){var _0x34f1c5={},_0x5a6ec9={},_0x3e9c80={'count':0x0,'rows':[]};var _0xe93ad4=_[_0xeb6b('0x2a')](db['ChatGroup'][_0xeb6b('0x2b')],function(_0x171e39){return{'name':_0x171e39[_0xeb6b('0x2c')],'type':_0x171e39[_0xeb6b('0x2d')][_0xeb6b('0x2e')]};});_0x5a6ec9['model']=_[_0xeb6b('0x2a')](_0xe93ad4,'name');_0x5a6ec9['query']=_[_0xeb6b('0x2f')](_0xc16b66['query']);_0x5a6ec9[_0xeb6b('0x30')]=_[_0xeb6b('0x31')](_0x5a6ec9[_0xeb6b('0x32')],_0x5a6ec9[_0xeb6b('0x33')]);_0x34f1c5[_0xeb6b('0x34')]=_['intersection'](_0x5a6ec9['model'],qs[_0xeb6b('0x35')](_0xc16b66[_0xeb6b('0x33')][_0xeb6b('0x35')]));_0x34f1c5[_0xeb6b('0x34')]=_0x34f1c5[_0xeb6b('0x34')][_0xeb6b('0x36')]?_0x34f1c5[_0xeb6b('0x34')]:_0x5a6ec9[_0xeb6b('0x32')];if(!_0xc16b66['query'][_0xeb6b('0x37')](_0xeb6b('0x38'))){_0x34f1c5[_0xeb6b('0x1e')]=qs[_0xeb6b('0x1e')](_0xc16b66[_0xeb6b('0x33')]['limit']);_0x34f1c5['offset']=qs[_0xeb6b('0x1d')](_0xc16b66['query'][_0xeb6b('0x1d')]);}_0x34f1c5['order']=qs[_0xeb6b('0x39')](_0xc16b66[_0xeb6b('0x33')][_0xeb6b('0x39')]);_0x34f1c5[_0xeb6b('0x3a')]=qs[_0xeb6b('0x30')](_[_0xeb6b('0x3b')](_0xc16b66[_0xeb6b('0x33')],_0x5a6ec9[_0xeb6b('0x30')]),_0xe93ad4);if(_0xc16b66['query']['filter']){_0x34f1c5[_0xeb6b('0x3a')]=_[_0xeb6b('0x3c')](_0x34f1c5['where'],{'$or':_['map'](_0xe93ad4,function(_0x235d0c){if(_0x235d0c[_0xeb6b('0x2d')]!==_0xeb6b('0x3d')){var _0x4debc4={};_0x4debc4[_0x235d0c[_0xeb6b('0x29')]]={'$like':'%'+_0xc16b66[_0xeb6b('0x33')][_0xeb6b('0x3e')]+'%'};return _0x4debc4;}})});}_0x34f1c5=_[_0xeb6b('0x3c')]({},_0x34f1c5,_0xc16b66[_0xeb6b('0x3f')]);var _0x5aa2bb={'where':_0x34f1c5[_0xeb6b('0x3a')]};return db[_0xeb6b('0x40')][_0xeb6b('0x1f')](_0x5aa2bb)[_0xeb6b('0x26')](function(_0x3a887c){_0x3e9c80[_0xeb6b('0x1f')]=_0x3a887c;if(_0xc16b66[_0xeb6b('0x33')]['includeAll']){_0x34f1c5[_0xeb6b('0x41')]=[{'all':!![]}];}return db[_0xeb6b('0x40')][_0xeb6b('0x42')](_0x34f1c5);})[_0xeb6b('0x26')](function(_0x4f4f4c){_0x3e9c80[_0xeb6b('0x43')]=_0x4f4f4c;return _0x3e9c80;})['then'](respondWithFilteredResult(_0x1b39d5,_0x34f1c5))['catch'](handleError(_0x1b39d5,null));};exports[_0xeb6b('0x44')]=function(_0x2cf9b5,_0x273b56){var _0x5b32dc={'raw':!![],'where':{'id':_0x2cf9b5['params']['id']}},_0x48972b={};_0x48972b[_0xeb6b('0x32')]=_['keys'](db['ChatGroup'][_0xeb6b('0x2b')]);_0x48972b[_0xeb6b('0x33')]=_[_0xeb6b('0x2f')](_0x2cf9b5['query']);_0x48972b[_0xeb6b('0x30')]=_['intersection'](_0x48972b[_0xeb6b('0x32')],_0x48972b['query']);_0x5b32dc['attributes']=_[_0xeb6b('0x31')](_0x48972b[_0xeb6b('0x32')],qs['fields'](_0x2cf9b5[_0xeb6b('0x33')]['fields']));_0x5b32dc[_0xeb6b('0x34')]=_0x5b32dc[_0xeb6b('0x34')][_0xeb6b('0x36')]?_0x5b32dc['attributes']:_0x48972b[_0xeb6b('0x32')];if(_0x2cf9b5['query'][_0xeb6b('0x45')]){_0x5b32dc[_0xeb6b('0x41')]=[{'all':!![]}];}_0x5b32dc=_[_0xeb6b('0x3c')]({},_0x5b32dc,_0x2cf9b5[_0xeb6b('0x3f')]);return db[_0xeb6b('0x40')][_0xeb6b('0x46')](_0x5b32dc)['then'](handleEntityNotFound(_0x273b56,null))[_0xeb6b('0x26')](respondWithResult(_0x273b56,null))[_0xeb6b('0x47')](handleError(_0x273b56,null));};exports[_0xeb6b('0x48')]=function(_0x105c03,_0xc0f572){return db[_0xeb6b('0x40')]['create'](_0x105c03[_0xeb6b('0x49')],{})[_0xeb6b('0x26')](respondWithResult(_0xc0f572,0xc9))['catch'](handleError(_0xc0f572,null));};exports[_0xeb6b('0x4a')]=function(_0x44ec46,_0x2a43bc){if(_0x44ec46[_0xeb6b('0x49')]['id']){delete _0x44ec46['body']['id'];}return db[_0xeb6b('0x40')][_0xeb6b('0x46')]({'where':{'id':_0x44ec46[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x2a43bc,null))[_0xeb6b('0x26')](saveUpdates(_0x44ec46[_0xeb6b('0x49')],null))[_0xeb6b('0x26')](respondWithResult(_0x2a43bc,null))[_0xeb6b('0x47')](handleError(_0x2a43bc,null));};exports[_0xeb6b('0x27')]=function(_0x5ee0a0,_0x5d12e3){return db[_0xeb6b('0x40')][_0xeb6b('0x46')]({'where':{'id':_0x5ee0a0[_0xeb6b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5d12e3,null))[_0xeb6b('0x26')](removeEntity(_0x5d12e3,null))['catch'](handleError(_0x5d12e3,null));};exports[_0xeb6b('0x4c')]=function(_0x35c187,_0x2c9841){return db['ChatGroup'][_0xeb6b('0x4c')]()[_0xeb6b('0x26')](respondWithResult(_0x2c9841,null))[_0xeb6b('0x47')](handleError(_0x2c9841,null));};exports['getUnread']=function(_0x3df0a3,_0x115ee3,_0x17f2e0){return db['ChatInternalMessage'][_0xeb6b('0x1f')]({'where':{'ChatGroupId':_0x3df0a3[_0xeb6b('0x4b')]['id'],'ToId':_0x3df0a3['user']['id'],'read':![]}})[_0xeb6b('0x26')](function(_0x1a33c6){return{'id':_[_0xeb6b('0x4d')](_0x3df0a3[_0xeb6b('0x4b')]['id']),'count':_0x1a33c6};})[_0xeb6b('0x26')](respondWithResult(_0x115ee3,null))[_0xeb6b('0x47')](handleError(_0x115ee3,null));};exports['addMembers']=function(_0x3b5b0d,_0x5c2e70,_0x2bd1cd){return db[_0xeb6b('0x40')][_0xeb6b('0x46')]({'where':{'id':_0x3b5b0d[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x5c2e70,null))[_0xeb6b('0x26')](function(_0x3b27b8){if(_0x3b27b8){return _0x3b27b8[_0xeb6b('0x4e')](_0x3b5b0d[_0xeb6b('0x49')][_0xeb6b('0x4f')],_[_0xeb6b('0x50')](_0x3b5b0d[_0xeb6b('0x49')],[_0xeb6b('0x4f'),'id'])||{});}})[_0xeb6b('0x26')](respondWithResult(_0x5c2e70,null))[_0xeb6b('0x47')](handleError(_0x5c2e70,null));};exports[_0xeb6b('0x51')]=function(_0x34ca1e,_0x4a2760,_0x3f76de){var _0x5c2d0b={};var _0x1d85f4={};var _0x569722;var _0x59e762;return db['ChatGroup']['findOne']({'where':{'id':_0x34ca1e[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x4a2760,null))[_0xeb6b('0x26')](function(_0x464ad7){if(_0x464ad7){_0x569722=_0x464ad7;_0x1d85f4[_0xeb6b('0x32')]=_[_0xeb6b('0x2f')](db[_0xeb6b('0x52')][_0xeb6b('0x2b')]);_0x1d85f4[_0xeb6b('0x33')]=_[_0xeb6b('0x2f')](_0x34ca1e[_0xeb6b('0x33')]);_0x1d85f4[_0xeb6b('0x30')]=_[_0xeb6b('0x31')](_0x1d85f4[_0xeb6b('0x32')],_0x1d85f4['query']);_0x5c2d0b[_0xeb6b('0x34')]=_[_0xeb6b('0x31')](_0x1d85f4[_0xeb6b('0x32')],qs[_0xeb6b('0x35')](_0x34ca1e[_0xeb6b('0x33')][_0xeb6b('0x35')]));_0x5c2d0b[_0xeb6b('0x34')]=_0x5c2d0b[_0xeb6b('0x34')]['length']?_0x5c2d0b['attributes']:_0x1d85f4[_0xeb6b('0x32')];_0x5c2d0b[_0xeb6b('0x53')]=qs['sort'](_0x34ca1e[_0xeb6b('0x33')][_0xeb6b('0x39')]);_0x5c2d0b[_0xeb6b('0x3a')]=qs[_0xeb6b('0x30')](_[_0xeb6b('0x3b')](_0x34ca1e[_0xeb6b('0x33')],_0x1d85f4[_0xeb6b('0x30')]));if(_0x34ca1e[_0xeb6b('0x33')][_0xeb6b('0x3e')]){_0x5c2d0b[_0xeb6b('0x3a')]=_[_0xeb6b('0x3c')](_0x5c2d0b['where'],{'$or':_[_0xeb6b('0x2a')](_0x5c2d0b[_0xeb6b('0x34')],function(_0x15d06f){var _0x33c0c2={};_0x33c0c2[_0x15d06f]={'$like':'%'+_0x34ca1e[_0xeb6b('0x33')][_0xeb6b('0x3e')]+'%'};return _0x33c0c2;})});}_0x5c2d0b=_[_0xeb6b('0x3c')]({},_0x5c2d0b,_0x34ca1e[_0xeb6b('0x3f')]);return _0x569722[_0xeb6b('0x51')](_0x5c2d0b);}})[_0xeb6b('0x26')](function(_0x5cd385){if(_0x5cd385){_0x59e762=_0x5cd385['length'];if(!_0x34ca1e[_0xeb6b('0x33')]['hasOwnProperty'](_0xeb6b('0x38'))){_0x5c2d0b[_0xeb6b('0x1e')]=qs['limit'](_0x34ca1e['query'][_0xeb6b('0x1e')]);_0x5c2d0b['offset']=qs[_0xeb6b('0x1d')](_0x34ca1e[_0xeb6b('0x33')]['offset']);}return _0x569722[_0xeb6b('0x51')](_0x5c2d0b);}})['then'](function(_0x3a8590){if(_0x3a8590){return _0x3a8590?{'count':_0x59e762,'rows':_0x3a8590}:null;}})['then'](respondWithResult(_0x4a2760,null))[_0xeb6b('0x47')](handleError(_0x4a2760,null));};exports[_0xeb6b('0x54')]=function(_0x3352ce,_0x46f69f,_0x1e0a10){return db[_0xeb6b('0x40')][_0xeb6b('0x46')]({'where':{'id':_0x3352ce[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x46f69f,null))[_0xeb6b('0x26')](function(_0x24f2db){if(_0x24f2db){return _0x24f2db[_0xeb6b('0x54')](_0x3352ce[_0xeb6b('0x33')]['ids']);}})[_0xeb6b('0x26')](respondWithStatusCode(_0x46f69f,null))[_0xeb6b('0x47')](handleError(_0x46f69f,null));};exports[_0xeb6b('0x55')]=function(_0x462b81,_0x1d5dd4,_0x5e3759){if(_0x462b81[_0xeb6b('0x49')]['id']){delete _0x462b81[_0xeb6b('0x49')]['id'];}return db['ChatGroup'][_0xeb6b('0x46')]({'where':{'id':_0x462b81[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x1d5dd4,null))['then'](function(_0x220fc1){if(_0x220fc1){_0x462b81['body']['ChatGroupId']=_0x220fc1['id'];return db['ChatInternalMessage'][_0xeb6b('0x48')](_0x462b81[_0xeb6b('0x49')]);}})[_0xeb6b('0x26')](respondWithResult(_0x1d5dd4,null))[_0xeb6b('0x47')](handleError(_0x1d5dd4,null));};exports[_0xeb6b('0x56')]=function(_0x3bf135,_0x3e27a8,_0xe624fd){var _0xdb5070={};var _0x4bc246={};var _0x492430;var _0x32af51;return db[_0xeb6b('0x40')][_0xeb6b('0x57')]({'where':{'id':_0x3bf135[_0xeb6b('0x4b')]['id']}})[_0xeb6b('0x26')](handleEntityNotFound(_0x3e27a8,null))[_0xeb6b('0x26')](function(_0x3d0a5e){if(_0x3d0a5e){_0x492430=_0x3d0a5e;_0x4bc246[_0xeb6b('0x32')]=_[_0xeb6b('0x2f')](db['ChatInternalMessage'][_0xeb6b('0x2b')]);_0x4bc246[_0xeb6b('0x33')]=_['keys'](_0x3bf135[_0xeb6b('0x33')]);_0x4bc246[_0xeb6b('0x30')]=_[_0xeb6b('0x31')](_0x4bc246[_0xeb6b('0x32')],_0x4bc246[_0xeb6b('0x33')]);_0xdb5070[_0xeb6b('0x34')]=_[_0xeb6b('0x31')](_0x4bc246[_0xeb6b('0x32')],qs[_0xeb6b('0x35')](_0x3bf135[_0xeb6b('0x33')]['fields']));_0xdb5070['attributes']=_0xdb5070['attributes'][_0xeb6b('0x36')]?_0xdb5070[_0xeb6b('0x34')]:_0x4bc246[_0xeb6b('0x32')];_0xdb5070[_0xeb6b('0x53')]=qs[_0xeb6b('0x39')](_0x3bf135[_0xeb6b('0x33')]['sort']);_0xdb5070[_0xeb6b('0x3a')]=qs[_0xeb6b('0x30')](_[_0xeb6b('0x3b')](_0x3bf135['query'],_0x4bc246[_0xeb6b('0x30')]));if(_0x3bf135['query'][_0xeb6b('0x3e')]){_0xdb5070[_0xeb6b('0x3a')]=_[_0xeb6b('0x3c')](_0xdb5070[_0xeb6b('0x3a')],{'$or':_[_0xeb6b('0x2a')](_0xdb5070[_0xeb6b('0x34')],function(_0x37824c){var _0x534e78={};_0x534e78[_0x37824c]={'$like':'%'+_0x3bf135[_0xeb6b('0x33')][_0xeb6b('0x3e')]+'%'};return _0x534e78;})});}if(_0x3bf135[_0xeb6b('0x33')]['$gte']){var _0x245d17=_0x3bf135[_0xeb6b('0x33')][_0xeb6b('0x58')][_0xeb6b('0x59')](',');var _0x466b0f={};_0x466b0f[_0x245d17[0x0]]={'$gte':moment(_0x245d17[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xdb5070[_0xeb6b('0x3a')]=_[_0xeb6b('0x3c')](_0xdb5070[_0xeb6b('0x3a')],_0x466b0f);}_0xdb5070=_[_0xeb6b('0x3c')]({},_0xdb5070,_0x3bf135[_0xeb6b('0x3f')]);return _0x492430['getMessages'](_0xdb5070);}})['then'](function(_0xb2e145){if(_0xb2e145){_0x32af51=_0xb2e145[_0xeb6b('0x36')];if(!_0x3bf135['query'][_0xeb6b('0x37')]('nolimit')){_0xdb5070['limit']=qs['limit'](_0x3bf135[_0xeb6b('0x33')][_0xeb6b('0x1e')]);_0xdb5070[_0xeb6b('0x1d')]=qs[_0xeb6b('0x1d')](_0x3bf135[_0xeb6b('0x33')][_0xeb6b('0x1d')]);}return _0x492430[_0xeb6b('0x56')](_0xdb5070);}})[_0xeb6b('0x26')](function(_0x4c95df){if(_0x4c95df){return _0x4c95df?{'count':_0x32af51,'rows':_0x4c95df}:null;}})[_0xeb6b('0x26')](respondWithResult(_0x3e27a8,null))[_0xeb6b('0x47')](handleError(_0x3e27a8,null));};
\ No newline at end of file
+var _0x2caf=['index','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','keys','length','includeAll','create','body','update','find','params','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','end','stack','name'];(function(_0x39a968,_0x364d93){var _0x47b0a5=function(_0x17c9dd){while(--_0x17c9dd){_0x39a968['push'](_0x39a968['shift']());}};_0x47b0a5(++_0x364d93);}(_0x2caf,0x96));var _0xf2ca=function(_0x53a68c,_0x540744){_0x53a68c=_0x53a68c-0x0;var _0x29f9c1=_0x2caf[_0x53a68c];return _0x29f9c1;};'use strict';var emlformat=require(_0xf2ca('0x0'));var rimraf=require(_0xf2ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2ca('0x2'));var rp=require('request-promise');var moment=require(_0xf2ca('0x3'));var BPromise=require(_0xf2ca('0x4'));var Mustache=require(_0xf2ca('0x5'));var util=require(_0xf2ca('0x6'));var path=require(_0xf2ca('0x7'));var sox=require(_0xf2ca('0x8'));var csv=require(_0xf2ca('0x9'));var ejs=require(_0xf2ca('0xa'));var fs=require('fs');var fs_extra=require(_0xf2ca('0xb'));var _=require(_0xf2ca('0xc'));var squel=require(_0xf2ca('0xd'));var crypto=require(_0xf2ca('0xe'));var jsforce=require(_0xf2ca('0xf'));var deskjs=require(_0xf2ca('0x10'));var toCsv=require(_0xf2ca('0x9'));var querystring=require(_0xf2ca('0x11'));var Papa=require(_0xf2ca('0x12'));var Redis=require(_0xf2ca('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf2ca('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2ca('0x15'))(_0xf2ca('0x16'));var utils=require(_0xf2ca('0x17'));var config=require(_0xf2ca('0x18'));var licenseUtil=require(_0xf2ca('0x19'));var db=require(_0xf2ca('0x1a'))['db'];config[_0xf2ca('0x1b')]=_[_0xf2ca('0x1c')](config[_0xf2ca('0x1b')],{'host':_0xf2ca('0x1d'),'port':0x18eb});var socket=require(_0xf2ca('0x1e'))(new Redis(config[_0xf2ca('0x1b')]));require(_0xf2ca('0x1f'))[_0xf2ca('0x20')](socket);function respondWithStatusCode(_0x45fab2,_0x1797c8){_0x1797c8=_0x1797c8||0xcc;return function(_0x5d8dcf){if(_0x5d8dcf){return _0x45fab2[_0xf2ca('0x21')](_0x1797c8);}return _0x45fab2['status'](_0x1797c8)['end']();};}function respondWithResult(_0x4dc664,_0x19244f){_0x19244f=_0x19244f||0xc8;return function(_0x13569b){if(_0x13569b){return _0x4dc664[_0xf2ca('0x22')](_0x19244f)[_0xf2ca('0x23')](_0x13569b);}};}function respondWithFilteredResult(_0xe74616,_0x1914f4){return function(_0x1d7048){if(_0x1d7048){var _0x1f47b9=typeof _0x1914f4[_0xf2ca('0x24')]===_0xf2ca('0x25')&&typeof _0x1914f4[_0xf2ca('0x26')]==='undefined';var _0x4831d6=_0x1d7048[_0xf2ca('0x27')];var _0x44cece=_0x1f47b9?0x0:_0x1914f4[_0xf2ca('0x24')];var _0x48195e=_0x1f47b9?_0x1d7048['count']:_0x1914f4[_0xf2ca('0x24')]+_0x1914f4[_0xf2ca('0x26')];var _0x1321d8;if(_0x48195e>=_0x4831d6){_0x48195e=_0x4831d6;_0x1321d8=0xc8;}else{_0x1321d8=0xce;}_0xe74616[_0xf2ca('0x22')](_0x1321d8);return _0xe74616[_0xf2ca('0x28')]('Content-Range',_0x44cece+'-'+_0x48195e+'/'+_0x4831d6)['json'](_0x1d7048);}return null;};}function patchUpdates(_0x2fc8e7){return function(_0x3057dd){try{jsonpatch[_0xf2ca('0x29')](_0x3057dd,_0x2fc8e7,!![]);}catch(_0x8cf96){return BPromise['reject'](_0x8cf96);}return _0x3057dd[_0xf2ca('0x2a')]();};}function saveUpdates(_0xbde9ad,_0x2185f8){return function(_0x11c4ac){if(_0x11c4ac){return _0x11c4ac['update'](_0xbde9ad)[_0xf2ca('0x2b')](function(_0x3766d3){return _0x3766d3;});}return null;};}function removeEntity(_0xb06112,_0x2c0c27){return function(_0x4e91df){if(_0x4e91df){return _0x4e91df[_0xf2ca('0x2c')]()['then'](function(){_0xb06112['status'](0xcc)[_0xf2ca('0x2d')]();});}};}function handleEntityNotFound(_0x473b31,_0x4a14d9){return function(_0x598132){if(!_0x598132){_0x473b31[_0xf2ca('0x21')](0x194);}return _0x598132;};}function handleError(_0x571ddf,_0x4e96cc){_0x4e96cc=_0x4e96cc||0x1f4;return function(_0x1d4a1b){logger['error'](_0x1d4a1b[_0xf2ca('0x2e')]);if(_0x1d4a1b[_0xf2ca('0x2f')]){delete _0x1d4a1b[_0xf2ca('0x2f')];}_0x571ddf[_0xf2ca('0x22')](_0x4e96cc)['send'](_0x1d4a1b);};}exports[_0xf2ca('0x30')]=function(_0x1ade32,_0x374c51){var _0x58ddbd={},_0x2e518f={},_0x161665={'count':0x0,'rows':[]};var _0x1ad8b8=_[_0xf2ca('0x31')](db[_0xf2ca('0x32')][_0xf2ca('0x33')],function(_0x3bbe8a){return{'name':_0x3bbe8a[_0xf2ca('0x34')],'type':_0x3bbe8a[_0xf2ca('0x35')]['key']};});_0x2e518f[_0xf2ca('0x36')]=_[_0xf2ca('0x31')](_0x1ad8b8,'name');_0x2e518f[_0xf2ca('0x37')]=_['keys'](_0x1ade32[_0xf2ca('0x37')]);_0x2e518f[_0xf2ca('0x38')]=_[_0xf2ca('0x39')](_0x2e518f[_0xf2ca('0x36')],_0x2e518f[_0xf2ca('0x37')]);_0x58ddbd[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0x2e518f[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x58ddbd[_0xf2ca('0x3a')]=_0x58ddbd['attributes']['length']?_0x58ddbd[_0xf2ca('0x3a')]:_0x2e518f['model'];if(!_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3c')](_0xf2ca('0x3d'))){_0x58ddbd['limit']=qs['limit'](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x58ddbd[_0xf2ca('0x24')]=qs[_0xf2ca('0x24')](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x24')]);}_0x58ddbd[_0xf2ca('0x3e')]=qs['sort'](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3f')]);_0x58ddbd[_0xf2ca('0x40')]=qs[_0xf2ca('0x38')](_['pick'](_0x1ade32[_0xf2ca('0x37')],_0x2e518f['filters']),_0x1ad8b8);if(_0x1ade32['query'][_0xf2ca('0x41')]){_0x58ddbd[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x58ddbd['where'],{'$or':_[_0xf2ca('0x31')](_0x1ad8b8,function(_0x40eca9){if(_0x40eca9[_0xf2ca('0x35')]!=='VIRTUAL'){var _0x23f5f7={};_0x23f5f7[_0x40eca9['name']]={'$like':'%'+_0x1ade32[_0xf2ca('0x37')]['filter']+'%'};return _0x23f5f7;}})});}_0x58ddbd=_['merge']({},_0x58ddbd,_0x1ade32[_0xf2ca('0x43')]);var _0x160683={'where':_0x58ddbd[_0xf2ca('0x40')]};return db[_0xf2ca('0x32')]['count'](_0x160683)['then'](function(_0x2243a5){_0x161665[_0xf2ca('0x27')]=_0x2243a5;if(_0x1ade32['query']['includeAll']){_0x58ddbd[_0xf2ca('0x44')]=[{'all':!![]}];}return db[_0xf2ca('0x32')][_0xf2ca('0x45')](_0x58ddbd);})[_0xf2ca('0x2b')](function(_0x1c5f51){_0x161665[_0xf2ca('0x46')]=_0x1c5f51;return _0x161665;})[_0xf2ca('0x2b')](respondWithFilteredResult(_0x374c51,_0x58ddbd))[_0xf2ca('0x47')](handleError(_0x374c51,null));};exports[_0xf2ca('0x48')]=function(_0x48b858,_0x1cb21f){var _0x44ef4a={'raw':!![],'where':{'id':_0x48b858['params']['id']}},_0xd63977={};_0xd63977['model']=_[_0xf2ca('0x49')](db['ChatGroup'][_0xf2ca('0x33')]);_0xd63977[_0xf2ca('0x37')]=_[_0xf2ca('0x49')](_0x48b858['query']);_0xd63977[_0xf2ca('0x38')]=_[_0xf2ca('0x39')](_0xd63977[_0xf2ca('0x36')],_0xd63977['query']);_0x44ef4a[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0xd63977[_0xf2ca('0x36')],qs['fields'](_0x48b858[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x44ef4a['attributes']=_0x44ef4a['attributes'][_0xf2ca('0x4a')]?_0x44ef4a[_0xf2ca('0x3a')]:_0xd63977['model'];if(_0x48b858[_0xf2ca('0x37')][_0xf2ca('0x4b')]){_0x44ef4a['include']=[{'all':!![]}];}_0x44ef4a=_[_0xf2ca('0x42')]({},_0x44ef4a,_0x48b858['options']);return db['ChatGroup']['find'](_0x44ef4a)[_0xf2ca('0x2b')](handleEntityNotFound(_0x1cb21f,null))[_0xf2ca('0x2b')](respondWithResult(_0x1cb21f,null))[_0xf2ca('0x47')](handleError(_0x1cb21f,null));};exports[_0xf2ca('0x4c')]=function(_0x3d599a,_0x492f05){return db[_0xf2ca('0x32')]['create'](_0x3d599a[_0xf2ca('0x4d')],{})[_0xf2ca('0x2b')](respondWithResult(_0x492f05,0xc9))[_0xf2ca('0x47')](handleError(_0x492f05,null));};exports[_0xf2ca('0x4e')]=function(_0xc33974,_0x310c8d){if(_0xc33974['body']['id']){delete _0xc33974[_0xf2ca('0x4d')]['id'];}return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0xc33974[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x310c8d,null))['then'](saveUpdates(_0xc33974[_0xf2ca('0x4d')],null))[_0xf2ca('0x2b')](respondWithResult(_0x310c8d,null))[_0xf2ca('0x47')](handleError(_0x310c8d,null));};exports['destroy']=function(_0x47e870,_0xdcbf5b){return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x47e870['params']['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0xdcbf5b,null))[_0xf2ca('0x2b')](removeEntity(_0xdcbf5b,null))[_0xf2ca('0x47')](handleError(_0xdcbf5b,null));};exports['describe']=function(_0x5ab2e2,_0xcdb771){return db[_0xf2ca('0x32')][_0xf2ca('0x51')]()[_0xf2ca('0x2b')](respondWithResult(_0xcdb771,null))[_0xf2ca('0x47')](handleError(_0xcdb771,null));};exports['getUnread']=function(_0x21453b,_0x5e331c,_0x26420d){return db['ChatInternalMessage'][_0xf2ca('0x27')]({'where':{'ChatGroupId':_0x21453b[_0xf2ca('0x50')]['id'],'ToId':_0x21453b[_0xf2ca('0x52')]['id'],'read':![]}})['then'](function(_0x2c0ae7){return{'id':_[_0xf2ca('0x53')](_0x21453b['params']['id']),'count':_0x2c0ae7};})[_0xf2ca('0x2b')](respondWithResult(_0x5e331c,null))['catch'](handleError(_0x5e331c,null));};exports[_0xf2ca('0x54')]=function(_0x8c2e2f,_0x559a98,_0x278028){return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x8c2e2f['params']['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x559a98,null))[_0xf2ca('0x2b')](function(_0x3b819b){if(_0x3b819b){return _0x3b819b[_0xf2ca('0x54')](_0x8c2e2f['body'][_0xf2ca('0x55')],_[_0xf2ca('0x56')](_0x8c2e2f[_0xf2ca('0x4d')],[_0xf2ca('0x55'),'id'])||{});}})[_0xf2ca('0x2b')](respondWithResult(_0x559a98,null))[_0xf2ca('0x47')](handleError(_0x559a98,null));};exports[_0xf2ca('0x57')]=function(_0xd50682,_0x72b8f,_0x36d334){var _0x23af16={};var _0x1d62ba={};var _0x40c3b7;var _0x52221a;return db['ChatGroup'][_0xf2ca('0x58')]({'where':{'id':_0xd50682[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x72b8f,null))[_0xf2ca('0x2b')](function(_0x5664db){if(_0x5664db){_0x40c3b7=_0x5664db;_0x1d62ba['model']=_[_0xf2ca('0x49')](db[_0xf2ca('0x59')][_0xf2ca('0x33')]);_0x1d62ba[_0xf2ca('0x37')]=_['keys'](_0xd50682[_0xf2ca('0x37')]);_0x1d62ba['filters']=_['intersection'](_0x1d62ba['model'],_0x1d62ba['query']);_0x23af16[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0x1d62ba[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x23af16[_0xf2ca('0x3a')]=_0x23af16[_0xf2ca('0x3a')][_0xf2ca('0x4a')]?_0x23af16['attributes']:_0x1d62ba[_0xf2ca('0x36')];_0x23af16['order']=qs[_0xf2ca('0x3f')](_0xd50682['query'][_0xf2ca('0x3f')]);_0x23af16[_0xf2ca('0x40')]=qs[_0xf2ca('0x38')](_[_0xf2ca('0x5a')](_0xd50682[_0xf2ca('0x37')],_0x1d62ba[_0xf2ca('0x38')]));if(_0xd50682['query'][_0xf2ca('0x41')]){_0x23af16[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x23af16['where'],{'$or':_['map'](_0x23af16[_0xf2ca('0x3a')],function(_0x5ab38b){var _0x556e97={};_0x556e97[_0x5ab38b]={'$like':'%'+_0xd50682[_0xf2ca('0x37')]['filter']+'%'};return _0x556e97;})});}_0x23af16=_[_0xf2ca('0x42')]({},_0x23af16,_0xd50682[_0xf2ca('0x43')]);return _0x40c3b7['getMembers'](_0x23af16);}})[_0xf2ca('0x2b')](function(_0x3d5c5a){if(_0x3d5c5a){_0x52221a=_0x3d5c5a[_0xf2ca('0x4a')];if(!_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x3c')](_0xf2ca('0x3d'))){_0x23af16[_0xf2ca('0x26')]=qs['limit'](_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x23af16[_0xf2ca('0x24')]=qs[_0xf2ca('0x24')](_0xd50682['query'][_0xf2ca('0x24')]);}return _0x40c3b7[_0xf2ca('0x57')](_0x23af16);}})[_0xf2ca('0x2b')](function(_0x815638){if(_0x815638){return _0x815638?{'count':_0x52221a,'rows':_0x815638}:null;}})[_0xf2ca('0x2b')](respondWithResult(_0x72b8f,null))['catch'](handleError(_0x72b8f,null));};exports[_0xf2ca('0x5b')]=function(_0x2508ec,_0x28be18,_0x39d46a){return db['ChatGroup'][_0xf2ca('0x4f')]({'where':{'id':_0x2508ec[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x28be18,null))[_0xf2ca('0x2b')](function(_0x468a72){if(_0x468a72){return _0x468a72['removeMembers'](_0x2508ec['query']['ids']);}})[_0xf2ca('0x2b')](respondWithStatusCode(_0x28be18,null))['catch'](handleError(_0x28be18,null));};exports[_0xf2ca('0x5c')]=function(_0x106b04,_0x3b4ffb,_0x1077ea){if(_0x106b04['body']['id']){delete _0x106b04['body']['id'];}return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x106b04['params']['id']}})['then'](handleEntityNotFound(_0x3b4ffb,null))['then'](function(_0x2b7baf){if(_0x2b7baf){_0x106b04[_0xf2ca('0x4d')]['ChatGroupId']=_0x2b7baf['id'];return db[_0xf2ca('0x5d')][_0xf2ca('0x4c')](_0x106b04[_0xf2ca('0x4d')]);}})[_0xf2ca('0x2b')](respondWithResult(_0x3b4ffb,null))[_0xf2ca('0x47')](handleError(_0x3b4ffb,null));};exports[_0xf2ca('0x5e')]=function(_0x2157b3,_0xab284a,_0x173505){var _0x3a4658={};var _0x217c25={};var _0x40bc8b;var _0x4b41ce;return db['ChatGroup'][_0xf2ca('0x58')]({'where':{'id':_0x2157b3[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0xab284a,null))[_0xf2ca('0x2b')](function(_0x1fb538){if(_0x1fb538){_0x40bc8b=_0x1fb538;_0x217c25[_0xf2ca('0x36')]=_[_0xf2ca('0x49')](db[_0xf2ca('0x5d')]['rawAttributes']);_0x217c25[_0xf2ca('0x37')]=_[_0xf2ca('0x49')](_0x2157b3[_0xf2ca('0x37')]);_0x217c25[_0xf2ca('0x38')]=_['intersection'](_0x217c25[_0xf2ca('0x36')],_0x217c25[_0xf2ca('0x37')]);_0x3a4658['attributes']=_[_0xf2ca('0x39')](_0x217c25[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0x2157b3['query'][_0xf2ca('0x3b')]));_0x3a4658['attributes']=_0x3a4658[_0xf2ca('0x3a')][_0xf2ca('0x4a')]?_0x3a4658[_0xf2ca('0x3a')]:_0x217c25[_0xf2ca('0x36')];_0x3a4658[_0xf2ca('0x3e')]=qs[_0xf2ca('0x3f')](_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x3f')]);_0x3a4658[_0xf2ca('0x40')]=qs['filters'](_['pick'](_0x2157b3['query'],_0x217c25[_0xf2ca('0x38')]));if(_0x2157b3['query']['filter']){_0x3a4658[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x3a4658[_0xf2ca('0x40')],{'$or':_[_0xf2ca('0x31')](_0x3a4658[_0xf2ca('0x3a')],function(_0x17ba04){var _0x433b7f={};_0x433b7f[_0x17ba04]={'$like':'%'+_0x2157b3['query']['filter']+'%'};return _0x433b7f;})});}if(_0x2157b3['query'][_0xf2ca('0x5f')]){var _0x24c227=_0x2157b3['query'][_0xf2ca('0x5f')][_0xf2ca('0x60')](',');var _0xde3057={};_0xde3057[_0x24c227[0x0]]={'$gte':moment(_0x24c227[0x1])[_0xf2ca('0x61')](_0xf2ca('0x62'))};_0x3a4658['where']=_[_0xf2ca('0x42')](_0x3a4658[_0xf2ca('0x40')],_0xde3057);}_0x3a4658=_[_0xf2ca('0x42')]({},_0x3a4658,_0x2157b3[_0xf2ca('0x43')]);return _0x40bc8b[_0xf2ca('0x5e')](_0x3a4658);}})['then'](function(_0x1b3d89){if(_0x1b3d89){_0x4b41ce=_0x1b3d89['length'];if(!_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x3c')]('nolimit')){_0x3a4658[_0xf2ca('0x26')]=qs[_0xf2ca('0x26')](_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x3a4658['offset']=qs[_0xf2ca('0x24')](_0x2157b3['query']['offset']);}return _0x40bc8b['getMessages'](_0x3a4658);}})[_0xf2ca('0x2b')](function(_0x1397b3){if(_0x1397b3){return _0x1397b3?{'count':_0x4b41ce,'rows':_0x1397b3}:null;}})['then'](respondWithResult(_0xab284a,null))[_0xf2ca('0x47')](handleError(_0xab284a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index eaee435..5386afe 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 _0x394d=['update','emit','hook','events','save'];(function(_0xf20f37,_0x435fb0){var _0x5185dd=function(_0x4e56ad){while(--_0x4e56ad){_0xf20f37['push'](_0xf20f37['shift']());}};_0x5185dd(++_0x435fb0);}(_0x394d,0x12a));var _0xd394=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x394d[_0x565ed7];return _0x183ad7;};'use strict';var EventEmitter=require(_0xd394('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd394('0x1'),'afterUpdate':_0xd394('0x2'),'afterDestroy':'remove'};function emitEvent(_0x410368){return function(_0x499c7c,_0x278b36,_0x5c765b){ChatGroupEvents['emit'](_0x410368+':'+_0x499c7c['id'],_0x499c7c);ChatGroupEvents[_0xd394('0x3')](_0x410368,_0x499c7c);_0x5c765b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xd394('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x3504=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0x3504,0xce));var _0x4350=function(_0x53aad7,_0x3964c7){_0x53aad7=_0x53aad7-0x0;var _0x3be51e=_0x3504[_0x53aad7];return _0x3be51e;};'use strict';var EventEmitter=require(_0x4350('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4350('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4350('0x2'),'afterDestroy':_0x4350('0x3')};function emitEvent(_0x568470){return function(_0x1b5485,_0x3b0f42,_0x5aa5a3){ChatGroupEvents[_0x4350('0x4')](_0x568470+':'+_0x1b5485['id'],_0x1b5485);ChatGroupEvents[_0x4350('0x4')](_0x568470,_0x1b5485);_0x5aa5a3(null);};}for(var e in events){if(events[_0x4350('0x5')](e)){var event=events[e];ChatGroup[_0x4350('0x6')](e,emitEvent(event));}}module[_0x4350('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 368b288..b42bfce 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 _0x0e48=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x0e48,0x120));var _0x80e4=function(_0x9fe87c,_0x1e9f2c){_0x9fe87c=_0x9fe87c-0x0;var _0x4822c5=_0x0e48[_0x9fe87c];return _0x4822c5;};'use strict';var _=require(_0x80e4('0x0'));var util=require(_0x80e4('0x1'));var logger=require(_0x80e4('0x2'))('api');var moment=require(_0x80e4('0x3'));var BPromise=require(_0x80e4('0x4'));var rp=require(_0x80e4('0x5'));var fs=require('fs');var path=require(_0x80e4('0x6'));var rimraf=require(_0x80e4('0x7'));var config=require('../../config/environment');var attributes=require(_0x80e4('0x8'));module[_0x80e4('0x9')]=function(_0x418f2a,_0x244386){return _0x418f2a[_0x80e4('0xa')](_0x80e4('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b82=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4b82,0xb6));var _0x24b8=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x4b82[_0x1b3564];return _0x504069;};'use strict';var _=require(_0x24b8('0x0'));var util=require(_0x24b8('0x1'));var logger=require(_0x24b8('0x2'))(_0x24b8('0x3'));var moment=require(_0x24b8('0x4'));var BPromise=require(_0x24b8('0x5'));var rp=require(_0x24b8('0x6'));var fs=require('fs');var path=require(_0x24b8('0x7'));var rimraf=require(_0x24b8('0x8'));var config=require(_0x24b8('0x9'));var attributes=require(_0x24b8('0xa'));module[_0x24b8('0xb')]=function(_0x2d82e0,_0x28c432){return _0x2d82e0[_0x24b8('0xc')](_0x24b8('0xd'),attributes,{'tableName':'chat_groups','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 83beb49..cca9a8d 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 _0x6b6d=['redis','defaults','localhost','socket.io-emitter','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x15a833,_0x5092d6){var _0x371593=function(_0x53b66b){while(--_0x53b66b){_0x15a833['push'](_0x15a833['shift']());}};_0x371593(++_0x5092d6);}(_0x6b6d,0xbd));var _0xd6b6=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x6b6d[_0x4bb145];return _0x4db596;};'use strict';var _=require(_0xd6b6('0x0'));var util=require(_0xd6b6('0x1'));var moment=require(_0xd6b6('0x2'));var BPromise=require(_0xd6b6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6b6('0x4'));var db=require(_0xd6b6('0x5'))['db'];var utils=require(_0xd6b6('0x6'));var logger=require(_0xd6b6('0x7'))('rpc');var config=require(_0xd6b6('0x8'));var jayson=require(_0xd6b6('0x9'));var client=jayson[_0xd6b6('0xa')]['http']({'port':0x232a});config[_0xd6b6('0xb')]=_[_0xd6b6('0xc')](config[_0xd6b6('0xb')],{'host':_0xd6b6('0xd'),'port':0x18eb});var socket=require(_0xd6b6('0xe'))(new Redis(config[_0xd6b6('0xb')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x362edc,_0x72ece2,_0x4d918d){return new BPromise(function(_0x3a5bf,_0x212d48){return client[_0xd6b6('0xf')](_0x362edc,_0x4d918d)[_0xd6b6('0x10')](function(_0x1d002b){logger[_0xd6b6('0x11')](_0xd6b6('0x12'),_0x72ece2,_0xd6b6('0x13'));logger[_0xd6b6('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x72ece2,_0xd6b6('0x13'),JSON[_0xd6b6('0x15')](_0x1d002b));if(_0x1d002b[_0xd6b6('0x16')]){if(_0x1d002b[_0xd6b6('0x16')]['code']===0x1f4){logger[_0xd6b6('0x16')](_0xd6b6('0x12'),_0x72ece2,_0x1d002b[_0xd6b6('0x16')][_0xd6b6('0x17')]);return _0x212d48(_0x1d002b[_0xd6b6('0x16')][_0xd6b6('0x17')]);}logger[_0xd6b6('0x16')](_0xd6b6('0x12'),_0x72ece2,_0x1d002b[_0xd6b6('0x16')][_0xd6b6('0x17')]);return _0x3a5bf(_0x1d002b[_0xd6b6('0x16')][_0xd6b6('0x17')]);}else{logger[_0xd6b6('0x11')](_0xd6b6('0x12'),_0x72ece2,_0xd6b6('0x13'));_0x3a5bf(_0x1d002b['result'][_0xd6b6('0x17')]);}})[_0xd6b6('0x18')](function(_0x13023b){logger[_0xd6b6('0x16')]('ChatGroup,\x20%s,\x20%s',_0x72ece2,_0x13023b);_0x212d48(_0x13023b);});});}
\ No newline at end of file
+var _0xf88f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3e19e3,_0x232e8c){var _0x59e523=function(_0x4a9240){while(--_0x4a9240){_0x3e19e3['push'](_0x3e19e3['shift']());}};_0x59e523(++_0x232e8c);}(_0xf88f,0x1bb));var _0xff88=function(_0x19b31d,_0x4ec9aa){_0x19b31d=_0x19b31d-0x0;var _0x498fbf=_0xf88f[_0x19b31d];return _0x498fbf;};'use strict';var _=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var moment=require(_0xff88('0x2'));var BPromise=require(_0xff88('0x3'));var rs=require(_0xff88('0x4'));var fs=require('fs');var Redis=require(_0xff88('0x5'));var db=require(_0xff88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xff88('0x7'))(_0xff88('0x8'));var config=require(_0xff88('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff88('0xa')][_0xff88('0xb')]({'port':0x232a});config[_0xff88('0xc')]=_[_0xff88('0xd')](config[_0xff88('0xc')],{'host':_0xff88('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff88('0xc')]));require(_0xff88('0xf'))[_0xff88('0x10')](socket);function respondWithRpcPromise(_0x4715fc,_0x3d5534,_0x3dcefc){return new BPromise(function(_0x22bca3,_0x178fc4){return client[_0xff88('0x11')](_0x4715fc,_0x3dcefc)[_0xff88('0x12')](function(_0xc1ee70){logger[_0xff88('0x13')](_0xff88('0x14'),_0x3d5534,_0xff88('0x15'));logger[_0xff88('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3d5534,_0xff88('0x15'),JSON[_0xff88('0x17')](_0xc1ee70));if(_0xc1ee70[_0xff88('0x18')]){if(_0xc1ee70['error'][_0xff88('0x19')]===0x1f4){logger[_0xff88('0x18')](_0xff88('0x14'),_0x3d5534,_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);return _0x178fc4(_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);}logger[_0xff88('0x18')]('ChatGroup,\x20%s,\x20%s',_0x3d5534,_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);return _0x22bca3(_0xc1ee70['error']['message']);}else{logger[_0xff88('0x13')](_0xff88('0x14'),_0x3d5534,'request\x20sent');_0x22bca3(_0xc1ee70[_0xff88('0x1b')][_0xff88('0x1a')]);}})['catch'](function(_0x2bafb1){logger[_0xff88('0x18')](_0xff88('0x14'),_0x3d5534,_0x2bafb1);_0x178fc4(_0x2bafb1);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index a74d961..cd9a837 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 _0xa016=['chatGroup:','save','remove','update','emit','removeListener','register','length'];(function(_0xe033e7,_0x561a6d){var _0x63031f=function(_0x246e1f){while(--_0x246e1f){_0xe033e7['push'](_0xe033e7['shift']());}};_0x63031f(++_0x561a6d);}(_0xa016,0x119));var _0x6a01=function(_0x42e328,_0x144e7a){_0x42e328=_0x42e328-0x0;var _0x10292f=_0xa016[_0x42e328];return _0x10292f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x6a01('0x0'),_0x6a01('0x1'),_0x6a01('0x2')];function createListener(_0x362315,_0x5cc973){return function(_0x3f1ba9){_0x5cc973[_0x6a01('0x3')](_0x362315,_0x3f1ba9);};}function removeListener(_0x5ab575,_0x5961d2){return function(){ChatGroupEvents[_0x6a01('0x4')](_0x5ab575,_0x5961d2);};}exports[_0x6a01('0x5')]=function(_0x273c9e){for(var _0x48fa8f=0x0,_0x10b044=events[_0x6a01('0x6')];_0x48fa8f<_0x10b044;_0x48fa8f++){var _0x3dc5a2=events[_0x48fa8f];var _0x5c19ae=createListener(_0x6a01('0x7')+_0x3dc5a2,_0x273c9e);ChatGroupEvents['on'](_0x3dc5a2,_0x5c19ae);}};
\ No newline at end of file
+var _0x8e68=['save','remove','emit','removeListener','register','length','./chatGroup.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e68,0x1e2));var _0x88e6=function(_0x277a4a,_0x4300e0){_0x277a4a=_0x277a4a-0x0;var _0x404ea6=_0x8e68[_0x277a4a];return _0x404ea6;};'use strict';var ChatGroupEvents=require(_0x88e6('0x0'));var events=[_0x88e6('0x1'),_0x88e6('0x2'),'update'];function createListener(_0x3acbaa,_0x10d1bf){return function(_0x10e2be){_0x10d1bf[_0x88e6('0x3')](_0x3acbaa,_0x10e2be);};}function removeListener(_0x5b83f7,_0x596e97){return function(){ChatGroupEvents[_0x88e6('0x4')](_0x5b83f7,_0x596e97);};}exports[_0x88e6('0x5')]=function(_0x34a1cc){for(var _0x5a214c=0x0,_0x100b9e=events[_0x88e6('0x6')];_0x5a214c<_0x100b9e;_0x5a214c++){var _0x1c72f4=events[_0x5a214c];var _0x5aea6c=createListener('chatGroup:'+_0x1c72f4,_0x34a1cc);ChatGroupEvents['on'](_0x1c72f4,_0x5aea6c);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index c5e4643..39cbe4f 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 _0x1c87=['index','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated'];(function(_0x41352a,_0x246ea2){var _0x3e392f=function(_0x11a5a6){while(--_0x11a5a6){_0x41352a['push'](_0x41352a['shift']());}};_0x3e392f(++_0x246ea2);}(_0x1c87,0x155));var _0x71c8=function(_0x2f5bf7,_0x428282){_0x2f5bf7=_0x2f5bf7-0x0;var _0x42128a=_0x1c87[_0x2f5bf7];return _0x42128a;};'use strict';var multer=require(_0x71c8('0x0'));var util=require(_0x71c8('0x1'));var path=require(_0x71c8('0x2'));var timeout=require('connect-timeout');var express=require(_0x71c8('0x3'));var router=express[_0x71c8('0x4')]();var fs_extra=require(_0x71c8('0x5'));var auth=require(_0x71c8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x71c8('0x7'));router[_0x71c8('0x8')]('/',auth[_0x71c8('0x9')](),controller[_0x71c8('0xa')]);router[_0x71c8('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x71c8('0x8')](_0x71c8('0xb'),auth['isAuthenticated'](),controller[_0x71c8('0xc')]);router[_0x71c8('0x8')](_0x71c8('0xd'),auth[_0x71c8('0x9')](),controller[_0x71c8('0xe')]);router[_0x71c8('0x8')](_0x71c8('0xf'),auth['isAuthenticated'](),controller[_0x71c8('0x10')]);router[_0x71c8('0x8')](_0x71c8('0x11'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x12')]);router[_0x71c8('0x13')]('/',auth[_0x71c8('0x9')](),controller[_0x71c8('0x14')]);router[_0x71c8('0x13')](_0x71c8('0xf'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x15')]);router['post'](_0x71c8('0x11'),auth['isAuthenticated'](),controller[_0x71c8('0x16')]);router['put'](_0x71c8('0xb'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x17')]);router[_0x71c8('0x18')](_0x71c8('0xb'),auth[_0x71c8('0x9')](),controller[_0x71c8('0x19')]);router[_0x71c8('0x18')](_0x71c8('0xf'),auth[_0x71c8('0x9')](),controller['removeMembers']);module[_0x71c8('0x1a')]=router;
\ No newline at end of file
+var _0x452e=['/:id/messages','post','/:id/members','addMembers','addMessage','put','update','destroy','delete','removeMembers','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x452e,0x96));var _0xe452=function(_0x5d64b0,_0x27840e){_0x5d64b0=_0x5d64b0-0x0;var _0x1f7342=_0x452e[_0x5d64b0];return _0x1f7342;};'use strict';var multer=require(_0xe452('0x0'));var util=require(_0xe452('0x1'));var path=require('path');var timeout=require(_0xe452('0x2'));var express=require(_0xe452('0x3'));var router=express[_0xe452('0x4')]();var fs_extra=require(_0xe452('0x5'));var auth=require(_0xe452('0x6'));var interaction=require(_0xe452('0x7'));var config=require(_0xe452('0x8'));var controller=require('./chatGroup.controller');router[_0xe452('0x9')]('/',auth[_0xe452('0xa')](),controller[_0xe452('0xb')]);router[_0xe452('0x9')](_0xe452('0xc'),auth[_0xe452('0xa')](),controller[_0xe452('0xd')]);router[_0xe452('0x9')](_0xe452('0xe'),auth[_0xe452('0xa')](),controller[_0xe452('0xf')]);router[_0xe452('0x9')](_0xe452('0x10'),auth[_0xe452('0xa')](),controller[_0xe452('0x11')]);router[_0xe452('0x9')]('/:id/members',auth[_0xe452('0xa')](),controller['getMembers']);router[_0xe452('0x9')](_0xe452('0x12'),auth[_0xe452('0xa')](),controller['getMessages']);router[_0xe452('0x13')]('/',auth[_0xe452('0xa')](),controller['create']);router[_0xe452('0x13')](_0xe452('0x14'),auth[_0xe452('0xa')](),controller[_0xe452('0x15')]);router[_0xe452('0x13')](_0xe452('0x12'),auth[_0xe452('0xa')](),controller[_0xe452('0x16')]);router[_0xe452('0x17')](_0xe452('0xe'),auth['isAuthenticated'](),controller[_0xe452('0x18')]);router['delete'](_0xe452('0xe'),auth[_0xe452('0xa')](),controller[_0xe452('0x19')]);router[_0xe452('0x1a')]('/:id/members',auth[_0xe452('0xa')](),controller[_0xe452('0x1b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index fc89997..350cabf 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 _0xf7b4=['ENUM','star','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','INTEGER'];(function(_0x408e07,_0x4d1a56){var _0x5c7fb7=function(_0x1b4031){while(--_0x1b4031){_0x408e07['push'](_0x408e07['shift']());}};_0x5c7fb7(++_0x4d1a56);}(_0xf7b4,0x152));var _0x4f7b=function(_0xe9f4a2,_0x50f0c4){_0xe9f4a2=_0xe9f4a2-0x0;var _0x25e066=_0xf7b4[_0xe9f4a2];return _0x25e066;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4f7b('0x1')]},'ratingType':{'type':Sequelize[_0x4f7b('0x2')]('star','thumb'),'defaultValue':_0x4f7b('0x3')},'ratingMessage':{'type':Sequelize[_0x4f7b('0x4')]},'pathTranscript':{'type':Sequelize[_0x4f7b('0x4')]},'mailTranscript':{'type':Sequelize[_0x4f7b('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4f7b('0x6')]},'disposition':{'type':Sequelize[_0x4f7b('0x5')]},'secondDisposition':{'type':Sequelize[_0x4f7b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4f7b('0x5')]},'note':{'type':Sequelize[_0x4f7b('0x5')]},'browserName':{'type':Sequelize[_0x4f7b('0x5')]},'browserVersion':{'type':Sequelize[_0x4f7b('0x5')]},'osName':{'type':Sequelize[_0x4f7b('0x5')]},'osVersion':{'type':Sequelize[_0x4f7b('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x4f7b('0x5')]},'deviceType':{'type':Sequelize[_0x4f7b('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x4f7b('0x5')]},'formData':{'type':Sequelize[_0x4f7b('0x4')](_0x4f7b('0x7'))},'read1stAt':{'type':Sequelize[_0x4f7b('0x6')]},'lastMsgAt':{'type':Sequelize[_0x4f7b('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4f7b('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4f7b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x4f7b('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xce3a=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN'];(function(_0x893787,_0x2ecfe4){var _0x4d2cb0=function(_0x486640){while(--_0x486640){_0x893787['push'](_0x893787['shift']());}};_0x4d2cb0(++_0x2ecfe4);}(_0xce3a,0x194));var _0xace3=function(_0x37fadf,_0xb0cf13){_0x37fadf=_0x37fadf-0x0;var _0x5b8739=_0xce3a[_0x37fadf];return _0x5b8739;};'use strict';var Sequelize=require(_0xace3('0x0'));module[_0xace3('0x1')]={'closed':{'type':Sequelize[_0xace3('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xace3('0x3')]},'ratingType':{'type':Sequelize[_0xace3('0x4')](_0xace3('0x5'),_0xace3('0x6')),'defaultValue':_0xace3('0x5')},'ratingMessage':{'type':Sequelize[_0xace3('0x7')]},'pathTranscript':{'type':Sequelize[_0xace3('0x7')]},'mailTranscript':{'type':Sequelize[_0xace3('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xace3('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xace3('0x8')]},'thirdDisposition':{'type':Sequelize[_0xace3('0x8')]},'note':{'type':Sequelize[_0xace3('0x8')]},'browserName':{'type':Sequelize[_0xace3('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xace3('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xace3('0x8')]},'deviceVendor':{'type':Sequelize[_0xace3('0x8')]},'deviceType':{'type':Sequelize[_0xace3('0x8')]},'referer':{'type':Sequelize[_0xace3('0x7')]},'customerIp':{'type':Sequelize[_0xace3('0x8')]},'formData':{'type':Sequelize[_0xace3('0x7')](_0xace3('0xa'))},'read1stAt':{'type':Sequelize[_0xace3('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xace3('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xace3('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 3743b38..dc896d8 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 _0x7815=['body','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooMetadata','vidaooApiKey','user','name','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','follow','isNull','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','filename','mimetype','attachmentDownload','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','%s%d','agentAlias','UserId','Visitor','website_alias','System','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','intersection','hasOwnProperty','nolimit','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','getMyMessages','order','pick','includeAgent','push','setTags','omit','spread','Tag','emit','removeTags','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','read','Account','Owner','Chat','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','createWriteStream','firstName','lastName','value','renderFile','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','undefined','count','json','destroy','end','stack','send','render','merge','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','chat','show','params','model','keys','ChatInteraction','query','filters','fields','attributes','length','includeAll','find','create','update'];(function(_0x26f03d,_0x4866c2){var _0x42dc9f=function(_0x110528){while(--_0x110528){_0x26f03d['push'](_0x26f03d['shift']());}};_0x42dc9f(++_0x4866c2);}(_0x7815,0x15c));var _0x5781=function(_0x231717,_0x280141){_0x231717=_0x231717-0x0;var _0x9a8e7b=_0x7815[_0x231717];return _0x9a8e7b;};'use strict';var rimraf=require(_0x5781('0x0'));var zipdir=require(_0x5781('0x1'));var rp=require('request-promise');var moment=require(_0x5781('0x2'));var BPromise=require(_0x5781('0x3'));var Mustache=require('mustache');var util=require(_0x5781('0x4'));var path=require(_0x5781('0x5'));var ejs=require(_0x5781('0x6'));var fs=require('fs');var _=require(_0x5781('0x7'));var Redis=require('ioredis');var interaction=require(_0x5781('0x8'));var qs=require(_0x5781('0x9'));var pdf=require(_0x5781('0xa'));var logger=require(_0x5781('0xb'))(_0x5781('0xc'));var config=require(_0x5781('0xd'));var db=require(_0x5781('0xe'))['db'];config[_0x5781('0xf')]=_[_0x5781('0x10')](config[_0x5781('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x5781('0x11'))(new Redis(config[_0x5781('0xf')]));require(_0x5781('0x12'))[_0x5781('0x13')](socket);var jayson=require(_0x5781('0x14'));var client=jayson[_0x5781('0x15')][_0x5781('0x16')]({'port':0x232b});var client9004=jayson[_0x5781('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x19f607,_0x14c0ef,_0x3d1445,_0x32b9fa){return new BPromise(function(_0x5bb0c7,_0x1147b2){var _0x457586=_0x32b9fa||client;return _0x457586['request'](_0x19f607,_0x3d1445)[_0x5781('0x17')](function(_0x2242c1){logger[_0x5781('0x18')](_0x5781('0x19'),_0x14c0ef,_0x5781('0x1a'));logger[_0x5781('0x1b')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x14c0ef,_0x5781('0x1a'),JSON[_0x5781('0x1c')](_0x2242c1));if(_0x2242c1['error']){if(_0x2242c1[_0x5781('0x1d')][_0x5781('0x1e')]===0x1f4){logger[_0x5781('0x1d')](_0x5781('0x19'),_0x14c0ef,_0x2242c1[_0x5781('0x1d')][_0x5781('0x1f')]);return _0x1147b2(_0x2242c1[_0x5781('0x1d')]['message']);}logger[_0x5781('0x1d')](_0x5781('0x19'),_0x14c0ef,_0x2242c1[_0x5781('0x1d')]['message']);return _0x5bb0c7(_0x2242c1['error'][_0x5781('0x1f')]);}else{logger['info'](_0x5781('0x19'),_0x14c0ef,_0x5781('0x1a'));_0x5bb0c7(_0x2242c1[_0x5781('0x20')]['message']);}})[_0x5781('0x21')](function(_0x5156e1){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x14c0ef,_0x5156e1);_0x1147b2(_0x5156e1);});});}function respondWithStatusCode(_0xb3835e,_0x2e0252){_0x2e0252=_0x2e0252||0xcc;return function(_0x3d2c12){if(_0x3d2c12){return _0xb3835e[_0x5781('0x22')](_0x2e0252);}return _0xb3835e[_0x5781('0x23')](_0x2e0252)['end']();};}function respondWithResult(_0x12220c,_0x102d43){_0x102d43=_0x102d43||0xc8;return function(_0x3a211e){if(_0x3a211e){return _0x12220c['status'](_0x102d43)['json'](_0x3a211e);}};}function respondWithFilteredResult(_0x2943c6,_0x3f6a94){return function(_0x2dc69d){if(_0x2dc69d){var _0x50671b=typeof _0x3f6a94[_0x5781('0x24')]==='undefined'&&typeof _0x3f6a94[_0x5781('0x25')]===_0x5781('0x26');var _0x3740e8=_0x2dc69d[_0x5781('0x27')];var _0x1d108d=_0x50671b?0x0:_0x3f6a94['offset'];var _0x3166f8=_0x50671b?_0x2dc69d['count']:_0x3f6a94[_0x5781('0x24')]+_0x3f6a94[_0x5781('0x25')];var _0x13a4a0;if(_0x3166f8>=_0x3740e8){_0x3166f8=_0x3740e8;_0x13a4a0=0xc8;}else{_0x13a4a0=0xce;}_0x2943c6['status'](_0x13a4a0);return _0x2943c6['set']('Content-Range',_0x1d108d+'-'+_0x3166f8+'/'+_0x3740e8)[_0x5781('0x28')](_0x2dc69d);}return null;};}function saveUpdates(_0x4da3a5){return function(_0x19eb31){if(_0x19eb31){return _0x19eb31['update'](_0x4da3a5)[_0x5781('0x17')](function(_0x4e98d6){return _0x4e98d6;});}return null;};}function removeEntity(_0x4cf40a){return function(_0x4d3367){if(_0x4d3367){return _0x4d3367[_0x5781('0x29')]()['then'](function(){_0x4cf40a[_0x5781('0x23')](0xcc)[_0x5781('0x2a')]();});}};}function handleEntityNotFound(_0x5db684){return function(_0x2216b5){if(!_0x2216b5){_0x5db684[_0x5781('0x22')](0x194);}return _0x2216b5;};}function handleError(_0x21bdfb,_0x15b46e){_0x15b46e=_0x15b46e||0x1f4;return function(_0x15f309){logger['error'](_0x15f309[_0x5781('0x2b')]);if(_0x15f309['name']){delete _0x15f309['name'];}_0x21bdfb['status'](_0x15b46e)[_0x5781('0x2c')](_0x15f309);};}function getMustacheRender(_0x153f99,_0x65b51){return Mustache[_0x5781('0x2d')](_0x153f99,_[_0x5781('0x2e')](_0x65b51['body'],{'contact':_0x65b51[_0x5781('0x2f')],'message':_0x65b51[_0x5781('0x1f')],'agent':_0x65b51[_0x5781('0x30')],'interaction':_0x65b51[_0x5781('0x31')],'account':_0x65b51[_0x5781('0x32')]}))||'';}exports[_0x5781('0x33')]=function(_0x5ccff4,_0x578616){var _0x2c4398={};var _0x11ceb7=_[_0x5781('0x34')](db['ChatInteraction'][_0x5781('0x35')],function(_0x43c61d){return{'name':_0x43c61d[_0x5781('0x36')],'type':_0x43c61d[_0x5781('0x37')][_0x5781('0x38')]};});_0x2c4398=qs[_0x5781('0x39')](_0x11ceb7,_0x5ccff4);return interaction[_0x5781('0x3a')](_0x5781('0x3b'),_0x5ccff4['query'],_0x5ccff4['user'],_0x2c4398,_0x11ceb7)[_0x5781('0x17')](respondWithFilteredResult(_0x578616,_0x2c4398))[_0x5781('0x21')](handleError(_0x578616,null));};exports[_0x5781('0x3c')]=function(_0x5a1fd1,_0xb83d0d){var _0x24dded={'raw':![],'where':{'id':_0x5a1fd1[_0x5781('0x3d')]['id']}},_0x493d2e={};_0x493d2e[_0x5781('0x3e')]=_[_0x5781('0x3f')](db[_0x5781('0x40')]['rawAttributes']);_0x493d2e[_0x5781('0x41')]=_[_0x5781('0x3f')](_0x5a1fd1[_0x5781('0x41')]);_0x493d2e[_0x5781('0x42')]=_['intersection'](_0x493d2e[_0x5781('0x3e')],_0x493d2e[_0x5781('0x41')]);_0x24dded['attributes']=_['intersection'](_0x493d2e[_0x5781('0x3e')],qs['fields'](_0x5a1fd1[_0x5781('0x41')][_0x5781('0x43')]));_0x24dded[_0x5781('0x44')]=_0x24dded['attributes'][_0x5781('0x45')]?_0x24dded[_0x5781('0x44')]:_0x493d2e[_0x5781('0x3e')];if(_0x5a1fd1[_0x5781('0x41')][_0x5781('0x46')]){_0x24dded['include']=[{'all':!![]}];}_0x24dded=_[_0x5781('0x2e')]({},_0x24dded,_0x5a1fd1['options']);return db[_0x5781('0x40')][_0x5781('0x47')](_0x24dded)[_0x5781('0x17')](handleEntityNotFound(_0xb83d0d,null))[_0x5781('0x17')](respondWithResult(_0xb83d0d,null))[_0x5781('0x21')](handleError(_0xb83d0d,null));};exports[_0x5781('0x48')]=function(_0x888371,_0x34d05f){return db[_0x5781('0x40')][_0x5781('0x48')](_0x888371['body'],{})[_0x5781('0x17')](respondWithResult(_0x34d05f,0xc9))[_0x5781('0x21')](handleError(_0x34d05f,null));};exports[_0x5781('0x49')]=function(_0x50d713,_0x49c9ce){if(_0x50d713[_0x5781('0x4a')]['id']){delete _0x50d713[_0x5781('0x4a')]['id'];}return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x50d713[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x49c9ce,null))[_0x5781('0x17')](saveUpdates(_0x50d713['body'],null))['then'](respondWithResult(_0x49c9ce,null))[_0x5781('0x21')](handleError(_0x49c9ce,null));};exports[_0x5781('0x29')]=function(_0x946f34,_0x32419d){return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x946f34[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x32419d,null))[_0x5781('0x17')](removeEntity(_0x32419d,null))[_0x5781('0x21')](handleError(_0x32419d,null));};exports[_0x5781('0x4b')]=function(_0x36e4fb,_0x36b276){return db['ChatInteraction'][_0x5781('0x4b')]()[_0x5781('0x17')](respondWithResult(_0x36b276,null))[_0x5781('0x21')](handleError(_0x36b276,null));};exports[_0x5781('0x4c')]=function(_0x5a2600,_0x10ca02){var _0x205adf=_0x5a2600[_0x5781('0x3d')]['id'];var _0x30c77e;var _0x3552a4;var _0x3b9ada;return db[_0x5781('0x40')][_0x5781('0x4d')]({'where':{'id':_0x205adf}})['then'](function(_0x1b845b){_0x30c77e=_0x1b845b;return db[_0x5781('0x4e')][_0x5781('0x4d')]({'where':{'id':_0x1b845b['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation',_0x5781('0x4f'),'vidaooNote',_0x5781('0x50')],'raw':!![]});})[_0x5781('0x17')](function(_0x5d2515){if(_0x5d2515&&_0x5d2515[_0x5781('0x51')]&&_0x5d2515['vidaooEscalation']){_0x3552a4=_0x5d2515;var _0x139c42={'interaction':{'id':_0x205adf},'agent':{'id':_0x5a2600[_0x5781('0x52')]['id'],'name':_0x5a2600[_0x5781('0x52')][_0x5781('0x53')],'fullname':_0x5a2600[_0x5781('0x52')][_0x5781('0x54')],'email':_0x5a2600[_0x5781('0x52')][_0x5781('0x55')]},'contact':_0x5a2600[_0x5781('0x4a')][_0x5781('0x2f')],'account':_0x5a2600[_0x5781('0x4a')][_0x5781('0x32')]};var _0x340f35={'rejectUnauthorized':![],'method':'POST','url':_0x5781('0x56'),'headers':{'X-APIKEY':_0x5d2515['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5a2600[_0x5781('0x52')][_0x5781('0x55')]],'buttons':null,'topic':_0x3552a4[_0x5781('0x4f')],'note':_['isNull'](_0x3552a4[_0x5781('0x57')])?null:getMustacheRender(_0x3552a4['vidaooNote'],_0x139c42),'metadata':null},'redirect':_0x5781('0x58'),'json':!![]};try{if(!_[_0x5781('0x59')](_0x3552a4[_0x5781('0x50')])){var _0x2751ee=getMustacheRender(_0x3552a4[_0x5781('0x50')],_0x139c42);var _0x4670b1=JSON[_0x5781('0x5a')](_0x2751ee);_0x340f35[_0x5781('0x4a')]['metadata']=_0x4670b1;}}catch(_0x56bfc6){throw new db[(_0x5781('0x5b'))]['ValidationError'](_0x5781('0x5c'));}return rp(_0x340f35);}else{throw new db[(_0x5781('0x5b'))]['ValidationError'](_0x5781('0x5d'));}})[_0x5781('0x17')](function(_0x54796f){_0x3b9ada=_0x54796f;if(_0x3b9ada['id']){var _0x1f7731={'body':_0x3b9ada[_0x5781('0x5e')],'ChatWebsiteId':_0x3552a4['id'],'ChatInteractionId':_0x30c77e['id'],'direction':_0x5781('0x5f'),'UserId':_0x5a2600[_0x5781('0x52')]['id']};return db[_0x5781('0x60')][_0x5781('0x48')](_0x1f7731,{});}else{throw new db[(_0x5781('0x5b'))][(_0x5781('0x61'))](_0x5781('0x62'));}})[_0x5781('0x17')](function(){return _0x30c77e[_0x5781('0x63')]({'vidaooSessionId':_0x3b9ada['id']});})[_0x5781('0x17')](respondWithResult(_0x10ca02,null))[_0x5781('0x21')](handleError(_0x10ca02,null));};exports[_0x5781('0x64')]=function(_0x546adc,_0x49c2d8){if(_0x546adc[_0x5781('0x4a')]['id']){delete _0x546adc[_0x5781('0x4a')]['id'];}return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x546adc[_0x5781('0x3d')]['id']},'include':[{'model':db[_0x5781('0x65')],'as':_0x5781('0x66')}]})['then'](handleEntityNotFound(_0x49c2d8,null))[_0x5781('0x17')](saveUpdates(_0x546adc[_0x5781('0x4a')],null))['then'](respondWithResult(_0x49c2d8,null))[_0x5781('0x21')](handleError(_0x49c2d8,null));};exports[_0x5781('0x67')]=function(_0x53deff,_0x4ba5b9){if(_0x53deff[_0x5781('0x4a')]['id']){delete _0x53deff[_0x5781('0x4a')]['id'];}return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x53deff[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](function(_0x26246b){if(!_0x26246b){logger[_0x5781('0x1d')](_0x5781('0x68'),_0x5781('0x67'),0x194,_0x5781('0x69'));_0x4ba5b9[_0x5781('0x22')](0x194);}else{if(_0x26246b['UserId']){throw new db[(_0x5781('0x5b'))]['ValidationError'](_0x5781('0x6a'));}}return _0x26246b;})[_0x5781('0x17')](function(_0x3fb290){if(_0x3fb290){return _0x3fb290[_0x5781('0x49')]({'closed':_0x53deff[_0x5781('0x4a')][_0x5781('0x6b')],'disposition':_0x53deff['body'][_0x5781('0x6c')]})['then'](function(_0x4dfdeb){return _0x4dfdeb;});}})[_0x5781('0x17')](function(){return respondWithRpcPromise(_0x5781('0x6d'),_0x5781('0x67'),_0x53deff[_0x5781('0x4a')],client9004);})['then'](respondWithResult(_0x4ba5b9,null))[_0x5781('0x21')](handleError(_0x4ba5b9,null));};exports['attachmentUpload']=function(_0x5bdf8b,_0x43d196){_0x5bdf8b[_0x5781('0x4a')]['name']=_0x5bdf8b[_0x5781('0x6e')][_0x5781('0x6f')];_0x5bdf8b[_0x5781('0x4a')]['basename']=_0x5bdf8b[_0x5781('0x6e')][_0x5781('0x70')];_0x5bdf8b[_0x5781('0x4a')][_0x5781('0x37')]=_0x5bdf8b['file'][_0x5781('0x71')];return db['Attachment'][_0x5781('0x48')](_0x5bdf8b[_0x5781('0x4a')])[_0x5781('0x17')](respondWithResult(_0x43d196,0xc9))[_0x5781('0x21')](handleError(_0x43d196,null));};exports[_0x5781('0x72')]=function(_0x5c2c5b,_0x28e8d4){return db[_0x5781('0x40')]['findOne']({'where':{'id':_0x5c2c5b[_0x5781('0x3d')]['id']},'raw':!![]})[_0x5781('0x17')](handleEntityNotFound(_0x28e8d4,null))['then'](function(_0x5479dc){if(_0x5479dc){if(_0x5479dc[_0x5781('0x6b')]){return _0x28e8d4[_0x5781('0x23')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x5781('0x73')]['findOne']({'where':{'id':_0x5c2c5b[_0x5781('0x41')][_0x5781('0x74')]},'raw':!![]})[_0x5781('0x17')](handleEntityNotFound(_0x28e8d4,null));}})[_0x5781('0x17')](function(_0x16e01e){if(_0x16e01e){var _0x248d65=_0x16e01e[_0x5781('0x75')]!==null;var _0x5e576f=path[_0x5781('0x76')](config[_0x5781('0x77')],'server/files/attachments/');if(_0x248d65){_0x5e576f=path['join'](_0x5e576f,_0x5781('0x78'));}var _0x504b1a=path[_0x5781('0x76')](_0x5e576f,_0x16e01e[_0x5781('0x79')]);return _0x28e8d4[_0x5781('0x7a')](_0x504b1a);}})['catch'](handleError(_0x28e8d4,null));};exports[_0x5781('0x7b')]=function(_0x548f92,_0x532e56){var _0x4403a3=null;var _0x250cdd=null;var _0x5a59d5=null;if(_0x548f92['body']['id']){delete _0x548f92[_0x5781('0x4a')]['id'];}if(_0x548f92[_0x5781('0x4a')]['mailTranscript']){_0x5a59d5=path[_0x5781('0x76')](config[_0x5781('0x77')],_0x5781('0x7c'),util[_0x5781('0x7d')]('transcript-%s.txt',Date[_0x5781('0x7e')]()));_0x548f92[_0x5781('0x4a')][_0x5781('0x7f')]=_0x5a59d5;}return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x548f92[_0x5781('0x3d')]['id']},'include':[{'model':db[_0x5781('0x60')],'as':_0x5781('0x80'),'include':[{'model':db[_0x5781('0x81')],'as':_0x5781('0x81')}]}]})[_0x5781('0x17')](handleEntityNotFound(_0x532e56,null))[_0x5781('0x17')](saveUpdates(_0x548f92[_0x5781('0x4a')],null))[_0x5781('0x17')](function(_0x28b242){if(_0x28b242){_0x4403a3=_0x28b242;return db['ChatWebsite']['find']({'where':{'id':_0x4403a3[_0x5781('0x82')]}});}})[_0x5781('0x17')](function(_0xbbb5a1){if(_0xbbb5a1){_0x250cdd=_0xbbb5a1;return db['CmContact'][_0x5781('0x47')]({'where':{'id':_0x4403a3[_0x5781('0x83')]}});}})['then'](function(_0x27341a){if(_0x27341a){if(_0x5a59d5){var _0x4b9a19=null;for(var _0x21b498=0x1;_0x21b498<_0x4403a3[_0x5781('0x80')][_0x5781('0x45')];++_0x21b498){_0x4b9a19=_0x4403a3[_0x5781('0x80')][_0x21b498];var _0x20bd97=_0x4b9a19['UserId']?util['format'](_0x5781('0x84'),_0x250cdd[_0x5781('0x85')],_0x4b9a19[_0x5781('0x86')]):'System';var _0x455697=_0x548f92[_0x5781('0x4a')]['customer']||util[_0x5781('0x7d')](_0x5781('0x84'),_0x5781('0x87'),_0x4b9a19[_0x5781('0x83')]);switch(_0x250cdd['agentIdentifier']){case _0x5781('0x88'):_0x20bd97=_0x4b9a19[_0x5781('0x86')]?util[_0x5781('0x7d')](_0x5781('0x84'),_0x250cdd[_0x5781('0x85')],_0x4b9a19[_0x5781('0x86')]):_0x5781('0x89');break;case _0x5781('0x8a'):_0x20bd97=_0x4b9a19['UserId']?_0x4b9a19[_0x5781('0x81')][_0x5781('0x8b')]||_0x4b9a19[_0x5781('0x81')][_0x5781('0x54')]:'System';break;case _0x5781('0x8c'):_0x20bd97=_0x4b9a19[_0x5781('0x86')]?_0x4b9a19[_0x5781('0x81')][_0x5781('0x54')]:_0x5781('0x89');break;default:_0x20bd97=_0x4b9a19[_0x5781('0x86')]?util[_0x5781('0x7d')]('%s%d',_0x250cdd[_0x5781('0x85')],_0x4b9a19[_0x5781('0x86')]):_0x5781('0x89');}var _0x350232=util[_0x5781('0x7d')]('[%s]\x20%s:\x20%s\x0a',moment(_0x4b9a19[_0x5781('0x8d')])[_0x5781('0x7d')](_0x5781('0x8e')),_0x4b9a19[_0x5781('0x8f')]==='in'?_0x455697:_0x20bd97,_0x4b9a19[_0x5781('0x4a')]);if(!_0x4b9a19[_0x5781('0x90')]){fs[_0x5781('0x91')](_0x5a59d5,_0x350232);}}return db[_0x5781('0x92')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x5781('0x93')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5781('0x94'),'raw':!![]}]}]});}}})[_0x5781('0x17')](function(_0xc9f0eb){if(!_0xc9f0eb||!_0xc9f0eb[_0x5781('0x95')]||!_0x548f92[_0x5781('0x4a')])return _0x4403a3;var _0x4cf994=_0xc9f0eb['getSmtpOptions']();return respondWithRpcPromise(_0x5781('0x96'),_0x5781('0x97'),{'account':_0x4cf994,'message':{'from':util['format'](_0x5781('0x98'),_0xc9f0eb[_0x5781('0x53')],_0xc9f0eb[_0x5781('0x55')]||_0xc9f0eb[_0x5781('0x95')][_0x5781('0x52')]),'to':_0x548f92[_0x5781('0x4a')][_0x5781('0x99')],'subject':_0x5781('0x9a'),'text':util[_0x5781('0x7d')](_0x5781('0x9b'),_0x548f92['body'][_0x5781('0x99')]),'attachments':[{'path':_0x5a59d5}]}})[_0x5781('0x17')](function(){return _0x4403a3;})[_0x5781('0x21')](function(_0x679381){logger['error'](_0x679381);});})[_0x5781('0x17')](respondWithStatusCode(_0x532e56,0xc8))['catch'](handleError(_0x532e56,null));};exports['addMessage']=function(_0x1a8028,_0x2685d5){return db[_0x5781('0x60')][_0x5781('0x47')]({'where':{'id':_0x1a8028[_0x5781('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2685d5,null))[_0x5781('0x17')](function(_0x52557d){if(_0x52557d){return _0x52557d[_0x5781('0x9c')](_0x1a8028[_0x5781('0x4a')][_0x5781('0x9d')],_['omit'](_0x1a8028[_0x5781('0x4a')],[_0x5781('0x9d'),'id'])||{});}})[_0x5781('0x17')](respondWithResult(_0x2685d5,null))[_0x5781('0x21')](handleError(_0x2685d5,null));};exports[_0x5781('0x9e')]=function(_0x5cc144,_0x5df9ee){var _0x12eafc={'raw':![],'where':{}};var _0xe0fd38={};var _0x5cdf2f={'count':0x0,'rows':[]};return db[_0x5781('0x40')][_0x5781('0x4d')]({'where':{'id':_0x5cc144[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x5df9ee,null))[_0x5781('0x17')](function(_0x470b87){if(_0x470b87){_0xe0fd38[_0x5781('0x3e')]=_[_0x5781('0x3f')](db[_0x5781('0x60')][_0x5781('0x35')]);_0xe0fd38[_0x5781('0x41')]=_['keys'](_0x5cc144[_0x5781('0x41')]);_0xe0fd38[_0x5781('0x42')]=_[_0x5781('0x9f')](_0xe0fd38[_0x5781('0x3e')],_0xe0fd38[_0x5781('0x41')]);_0x12eafc[_0x5781('0x44')]=_[_0x5781('0x9f')](_0xe0fd38[_0x5781('0x3e')],qs[_0x5781('0x43')](_0x5cc144[_0x5781('0x41')]['fields']));_0x12eafc[_0x5781('0x44')]=_0x12eafc[_0x5781('0x44')]['length']?_0x12eafc[_0x5781('0x44')]:_0xe0fd38[_0x5781('0x3e')];if(!_0x5cc144['query'][_0x5781('0xa0')](_0x5781('0xa1'))){_0x12eafc['limit']=qs[_0x5781('0x25')](_0x5cc144[_0x5781('0x41')]['limit']);_0x12eafc[_0x5781('0x24')]=qs[_0x5781('0x24')](_0x5cc144['query'][_0x5781('0x24')]);}_0x12eafc['order']=qs['sort'](_0x5cc144[_0x5781('0x41')][_0x5781('0xa2')]);_0x12eafc[_0x5781('0xa3')]=qs[_0x5781('0x42')](_['pick'](_0x5cc144[_0x5781('0x41')],_0xe0fd38['filters']));_0x12eafc[_0x5781('0xa3')][_0x5781('0xa4')]=_0x470b87['id'];if(_0x5cc144[_0x5781('0x41')]['filter']){_0x12eafc[_0x5781('0xa3')]=_[_0x5781('0x2e')](_0x12eafc[_0x5781('0xa3')],{'$or':_[_0x5781('0x34')](_0x12eafc['attributes'],function(_0x9c1c5){var _0x287f30={};_0x287f30[_0x9c1c5]={'$like':'%'+_0x5cc144['query'][_0x5781('0xa5')]+'%'};return _0x287f30;})});}if(_0x5cc144[_0x5781('0x41')][_0x5781('0xa6')]){var _0x42845f=_0x5cc144['query']['$gte'][_0x5781('0xa7')](',');var _0x9a2e0a={};_0x9a2e0a[_0x42845f[0x0]]={'$gte':moment(_0x42845f[0x1])[_0x5781('0x7d')](_0x5781('0xa8'))};_0x12eafc['where']=_['merge'](_0x12eafc[_0x5781('0xa3')],_0x9a2e0a);}_0x12eafc=_['merge']({},_0x12eafc,_0x5cc144[_0x5781('0xa9')]);return db[_0x5781('0x60')]['count']({'where':_0x12eafc[_0x5781('0xa3')]})['then'](function(_0x2b2f3e){_0x5cdf2f[_0x5781('0x27')]=_0x2b2f3e;if(_0x5cc144[_0x5781('0x41')][_0x5781('0x46')]){_0x12eafc[_0x5781('0xaa')]=[{'all':!![]}];}return db[_0x5781('0x60')][_0x5781('0x3a')](_0x12eafc);})[_0x5781('0x17')](function(_0x1755f7){_0x5cdf2f[_0x5781('0xab')]=_0x1755f7;return _0x5cdf2f;});}})[_0x5781('0x17')](respondWithFilteredResult(_0x5df9ee,_0x12eafc))[_0x5781('0x21')](handleError(_0x5df9ee,null));};exports[_0x5781('0xac')]=function(_0x7acc46,_0x9f9544){var _0x1c157a={'where':{}},_0x24791d={},_0x3e9bcc={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x7acc46['params']['id']}})['then'](handleEntityNotFound(_0x9f9544,null))[_0x5781('0x17')](function(_0x3a195e){if(_0x3a195e){_0x24791d[_0x5781('0x3e')]=_[_0x5781('0x3f')](db[_0x5781('0x60')][_0x5781('0x35')]);_0x24791d['query']=_[_0x5781('0x3f')](_0x7acc46['query']);_0x24791d[_0x5781('0x42')]=_[_0x5781('0x9f')](_0x24791d['model'],_0x24791d[_0x5781('0x41')]);_0x1c157a[_0x5781('0x44')]=_[_0x5781('0x9f')](_0x24791d[_0x5781('0x3e')],qs[_0x5781('0x43')](_0x7acc46['query'][_0x5781('0x43')]));_0x1c157a[_0x5781('0x44')]=_0x1c157a[_0x5781('0x44')][_0x5781('0x45')]?_0x1c157a[_0x5781('0x44')]:_0x24791d[_0x5781('0x3e')];if(!_0x7acc46[_0x5781('0x41')][_0x5781('0xa0')](_0x5781('0xa1'))){_0x1c157a[_0x5781('0x25')]=qs[_0x5781('0x25')](_0x7acc46[_0x5781('0x41')][_0x5781('0x25')]);_0x1c157a['offset']=qs['offset'](_0x7acc46[_0x5781('0x41')][_0x5781('0x24')]);}_0x1c157a[_0x5781('0xad')]=qs[_0x5781('0xa2')](_0x7acc46[_0x5781('0x41')]['sort']);_0x1c157a['where']=qs[_0x5781('0x42')](_[_0x5781('0xae')](_0x7acc46[_0x5781('0x41')],_0x24791d[_0x5781('0x42')]));_0x1c157a[_0x5781('0xa3')]['ChatInteractionId']=_0x3a195e['id'];if(_0x7acc46[_0x5781('0x41')][_0x5781('0xa5')]){_0x1c157a[_0x5781('0xa3')]=_[_0x5781('0x2e')](_0x1c157a[_0x5781('0xa3')],{'$or':_['map'](_0x1c157a[_0x5781('0x44')],function(_0x51ff80){var _0x4cbad2={};_0x4cbad2[_0x51ff80]={'$like':'%'+_0x7acc46[_0x5781('0x41')][_0x5781('0xa5')]+'%'};return _0x4cbad2;})});}_0x1c157a[_0x5781('0xa3')][_0x5781('0x90')]=![];if(_0x7acc46['query']['id']){_0x1c157a[_0x5781('0xa3')]['id']={'$gt':_0x7acc46[_0x5781('0x41')]['id']};}_0x1c157a=_['merge']({},_0x1c157a,_0x7acc46[_0x5781('0xa9')]);return db[_0x5781('0x60')][_0x5781('0x27')]({'where':_0x1c157a[_0x5781('0xa3')]})['then'](function(_0x536b4e){_0x3e9bcc[_0x5781('0x27')]=_0x536b4e;_0x1c157a[_0x5781('0xaa')]=[];if(_0x7acc46[_0x5781('0x41')][_0x5781('0xaf')]){_0x1c157a[_0x5781('0xaa')][_0x5781('0xb0')]({'model':db[_0x5781('0x81')],'as':_0x5781('0x81'),'attributes':['id',_0x5781('0x54'),_0x5781('0x8b')]});}if(_0x7acc46[_0x5781('0x41')][_0x5781('0x46')]){_0x1c157a[_0x5781('0xaa')]=[{'all':!![]}];}return db[_0x5781('0x60')][_0x5781('0x3a')](_0x1c157a);})[_0x5781('0x17')](function(_0x399066){_0x3e9bcc['rows']=_0x399066;return _0x3e9bcc;});}})[_0x5781('0x17')](respondWithFilteredResult(_0x9f9544,_0x1c157a))[_0x5781('0x21')](handleError(_0x9f9544,null));};exports['addTags']=function(_0x1620f8,_0x356f20){return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x1620f8['params']['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x356f20,null))[_0x5781('0x17')](function(_0x553f89){if(_0x553f89){return _0x553f89[_0x5781('0xb1')](_0x1620f8['body']['ids'],_[_0x5781('0xb2')](_0x1620f8[_0x5781('0x4a')],['ids','id'])||{})[_0x5781('0xb3')](function(){return db[_0x5781('0xb4')][_0x5781('0x3a')]({'attributes':['id',_0x5781('0x53'),'color'],'where':{'id':_0x1620f8[_0x5781('0x4a')]['ids']}});})[_0x5781('0x17')](function(_0x33ccc3){socket[_0x5781('0xb5')]('chatInteractionTags:save',{'id':Number(_0x1620f8[_0x5781('0x3d')]['id']),'tags':_0x33ccc3||[]});return{'id':Number(_0x1620f8['params']['id']),'tags':_0x33ccc3||[]};});}})[_0x5781('0x17')](respondWithResult(_0x356f20,null))['catch'](handleError(_0x356f20,null));};exports['removeTags']=function(_0x5395b5,_0x3589a9){return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x5395b5[_0x5781('0x3d')]['id']}})[_0x5781('0x17')](handleEntityNotFound(_0x3589a9,null))[_0x5781('0x17')](function(_0x5e1d53){if(_0x5e1d53){return _0x5e1d53[_0x5781('0xb6')](_0x5395b5['query'][_0x5781('0x9d')]);}})[_0x5781('0x17')](respondWithStatusCode(_0x3589a9,null))[_0x5781('0x21')](handleError(_0x3589a9,null));};exports['download']=function(_0x1fd201,_0x5916e2){var _0x42ee87=moment()[_0x5781('0xb7')]()[_0x5781('0xb8')]();var _0x40c21d=path[_0x5781('0x76')](config[_0x5781('0x77')],_0x5781('0xb9'),'files',_0x5781('0xba'));var _0x770fef=path[_0x5781('0x76')](config[_0x5781('0x77')],_0x5781('0xb9'),_0x5781('0xbb'),_0x5781('0xbc'));var _0x591502=path['join'](_0x40c21d,_0x42ee87);var _0x544a55=util[_0x5781('0x7d')](_0x5781('0xbd'),_0x1fd201[_0x5781('0x3d')]['id'],_0x42ee87);var _0x4a4be0=path[_0x5781('0x76')](_0x40c21d,_0x544a55);var _0x5867e9=[];_0x5867e9['push']({'model':db[_0x5781('0x81')],'as':_0x5781('0x81'),'attributes':['id',_0x5781('0x54')],'raw':!![]});_0x5867e9[_0x5781('0xb0')]({'model':db[_0x5781('0x65')],'as':_0x5781('0x66'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x1fd201[_0x5781('0x41')][_0x5781('0xbc')]){_0x5867e9[_0x5781('0xb0')]({'model':db[_0x5781('0x73')],'as':_0x5781('0x73'),'raw':!![]});}var _0x48f307=[{'model':db['ChatMessage'],'as':_0x5781('0x80'),'attributes':['id',_0x5781('0x4a'),'createdAt',_0x5781('0x8f'),_0x5781('0x90'),_0x5781('0xbe')],'include':_0x5867e9}];_0x48f307[_0x5781('0xb0')]({'model':db[_0x5781('0x4e')],'as':_0x5781('0xbf'),'attributes':['id',_0x5781('0x53')]});_0x48f307[_0x5781('0xb0')]({'model':db[_0x5781('0x81')],'as':_0x5781('0xc0'),'attributes':['id',_0x5781('0x54')]});return db[_0x5781('0x40')][_0x5781('0x47')]({'where':{'id':_0x1fd201[_0x5781('0x3d')]['id']},'include':_0x48f307})[_0x5781('0x17')](handleEntityNotFound(_0x5916e2,null))[_0x5781('0x17')](function(_0x3e30b9){if(_0x3e30b9){var _0x5222ec=_0x3e30b9['get']({'plain':!![]});fs['mkdirSync'](_0x591502);var _0x39aec2={'channel':_0x5781('0xc1'),'account':_0x5222ec[_0x5781('0xbf')]['name'],'agent':_0x5222ec['Owner']?_0x5222ec[_0x5781('0xc0')]['fullname']:'N.A.','createdAt':moment(_0x5222ec[_0x5781('0x8d')])[_0x5781('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5781('0xb8')](),'closedAt':_0x5222ec[_0x5781('0x6b')]?moment(_0x5222ec['closedAt'])[_0x5781('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5781('0xb8')]():'','disposition':_0x5222ec['disposition'],'chatInfo':{'browser':_0x5222ec[_0x5781('0xc2')],'os':_0x5222ec[_0x5781('0xc3')],'referer':_0x5222ec[_0x5781('0xc4')],'customerIp':_0x5222ec[_0x5781('0xc5')],'customerPort':_0x5222ec[_0x5781('0xc6')]?_0x5222ec[_0x5781('0xc6')]:_0x5781('0xc7')},'messages':_(_0x5222ec['Messages'])['tail']()[_0x5781('0xa5')]({'secret':![]})[_0x5781('0x34')](function(_0x235993){if(_0x235993['Attachment']){var _0x1b33a4=path['join'](_0x770fef,_0x235993[_0x5781('0x73')][_0x5781('0x79')]);if(fs[_0x5781('0xc8')](_0x1b33a4)){fs[_0x5781('0xc9')](_0x1b33a4)['pipe'](fs[_0x5781('0xca')](path[_0x5781('0x76')](_0x591502,_0x235993['Attachment'][_0x5781('0x79')])));}}return{'date':moment(_0x235993[_0x5781('0x8d')])['format'](_0x5781('0xa8'))[_0x5781('0xb8')](),'sender':_0x235993['direction']===_0x5781('0x5f')?_0x235993['User']?_0x235993[_0x5781('0x81')][_0x5781('0x54')]:_0x5781('0x89'):_0x235993[_0x5781('0x66')][_0x5781('0xcb')]+(_0x235993[_0x5781('0x66')][_0x5781('0xcc')]?'\x20'+_0x235993[_0x5781('0x66')][_0x5781('0xcc')]:''),'body':_0x235993[_0x5781('0x73')]?_0x235993[_0x5781('0x73')][_0x5781('0x79')]:_0x235993[_0x5781('0x4a')],'direction':_0x235993[_0x5781('0x8f')]===_0x5781('0x5f')?'A':'C','secret':_0x235993[_0x5781('0x90')],'read':_0x235993[_0x5781('0xbe')],'attachment':_0x235993[_0x5781('0x73')]};})[_0x5781('0xcd')]()};return ejs[_0x5781('0xce')](path[_0x5781('0x76')](config[_0x5781('0x77')],_0x5781('0xb9'),'views',_0x5781('0xcf')),{'interaction':_0x39aec2})[_0x5781('0x17')](function(_0x1c6c71){var _0x4410cb=path[_0x5781('0x76')](_0x591502,'transcript-'+_0x5222ec['id']+'-'+_0x42ee87+'.pdf');var _0x22e106={'path':_0x4410cb,'channel':_0x5781('0xc1'),'interactionId':_0x5222ec['id']};return pdf[_0x5781('0xd0')](_0x1c6c71,_0x22e106);})[_0x5781('0x17')](function(){return new Promise(function(_0x278d8e,_0x21d868){zipdir(_0x591502,{'saveTo':_0x4a4be0},function(_0x48510c,_0x2c343e){if(_0x48510c)return _0x21d868(_0x48510c);return _0x278d8e(_0x2c343e);});})[_0x5781('0x17')](function(){return new BPromise(function(_0x54dfe2,_0x299bf5){rimraf(_0x591502,function(_0x2516ce){if(_0x2516ce)_0x299bf5(_0x2516ce);return _0x54dfe2();});});})[_0x5781('0x17')](function(){return _0x5916e2['download'](_0x4a4be0,_0x544a55,function(_0x43e2b3){if(_0x43e2b3){logger['error'](_0x5781('0xd1'),_0x43e2b3);}else{fs[_0x5781('0xd2')](_0x4a4be0);}});});});}else{return _0x5916e2[_0x5781('0x22')](0xc8);}})['catch'](handleError(_0x5916e2,null));};
\ No newline at end of file
+var _0x3677=['query','user','show','params','model','keys','intersection','attributes','includeAll','include','create','body','update','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','close','root','server/files/chat/upload/','now','pathTranscript','ChatMessage','Messages','ContactId','format','%s%d','agentAlias','UserId','System','customer','Visitor','User','alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','addMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','fields','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','createdAt','read','Account','Owner','get','N.A.','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','transcript-','.pdf','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','json','undefined','limit','offset','count','Content-Range','then','destroy','name','render','merge','contact','interaction','index','map','ChatInteraction','rawAttributes','type','key','getOptions','chat'];(function(_0x57c16a,_0x31eedc){var _0x506317=function(_0x5f192d){while(--_0x5f192d){_0x57c16a['push'](_0x57c16a['shift']());}};_0x506317(++_0x31eedc);}(_0x3677,0x163));var _0x7367=function(_0x1bc7fb,_0x1a6fa8){_0x1bc7fb=_0x1bc7fb-0x0;var _0x348f52=_0x3677[_0x1bc7fb];return _0x348f52;};'use strict';var rimraf=require(_0x7367('0x0'));var zipdir=require(_0x7367('0x1'));var rp=require(_0x7367('0x2'));var moment=require(_0x7367('0x3'));var BPromise=require(_0x7367('0x4'));var Mustache=require(_0x7367('0x5'));var util=require(_0x7367('0x6'));var path=require(_0x7367('0x7'));var ejs=require(_0x7367('0x8'));var fs=require('fs');var _=require(_0x7367('0x9'));var Redis=require('ioredis');var interaction=require(_0x7367('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x7367('0xb'));var logger=require('../../config/logger')(_0x7367('0xc'));var config=require(_0x7367('0xd'));var db=require(_0x7367('0xe'))['db'];config[_0x7367('0xf')]=_[_0x7367('0x10')](config[_0x7367('0xf')],{'host':_0x7367('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7367('0xf')]));require(_0x7367('0x12'))[_0x7367('0x13')](socket);var jayson=require(_0x7367('0x14'));var client=jayson[_0x7367('0x15')][_0x7367('0x16')]({'port':0x232b});var client9004=jayson[_0x7367('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3291a6,_0x531e8f,_0x4c7ace,_0x28d7ad){return new BPromise(function(_0x3468af,_0x4f75fe){var _0xd4df9c=_0x28d7ad||client;return _0xd4df9c[_0x7367('0x17')](_0x3291a6,_0x4c7ace)['then'](function(_0x34ea47){logger[_0x7367('0x18')](_0x7367('0x19'),_0x531e8f,'request\x20sent');logger['debug'](_0x7367('0x1a'),_0x531e8f,_0x7367('0x1b'),JSON[_0x7367('0x1c')](_0x34ea47));if(_0x34ea47['error']){if(_0x34ea47[_0x7367('0x1d')][_0x7367('0x1e')]===0x1f4){logger['error'](_0x7367('0x19'),_0x531e8f,_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);return _0x4f75fe(_0x34ea47['error'][_0x7367('0x1f')]);}logger[_0x7367('0x1d')](_0x7367('0x19'),_0x531e8f,_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);return _0x3468af(_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);}else{logger[_0x7367('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x531e8f,_0x7367('0x1b'));_0x3468af(_0x34ea47[_0x7367('0x20')][_0x7367('0x1f')]);}})[_0x7367('0x21')](function(_0x1af053){logger['error'](_0x7367('0x19'),_0x531e8f,_0x1af053);_0x4f75fe(_0x1af053);});});}function respondWithStatusCode(_0x11ce72,_0x36a4f4){_0x36a4f4=_0x36a4f4||0xcc;return function(_0x542748){if(_0x542748){return _0x11ce72['sendStatus'](_0x36a4f4);}return _0x11ce72['status'](_0x36a4f4)[_0x7367('0x22')]();};}function respondWithResult(_0x3907e8,_0x54c835){_0x54c835=_0x54c835||0xc8;return function(_0x5385bd){if(_0x5385bd){return _0x3907e8[_0x7367('0x23')](_0x54c835)[_0x7367('0x24')](_0x5385bd);}};}function respondWithFilteredResult(_0xb5d3dd,_0x2a2a21){return function(_0x4226b3){if(_0x4226b3){var _0x2c946b=typeof _0x2a2a21['offset']===_0x7367('0x25')&&typeof _0x2a2a21[_0x7367('0x26')]==='undefined';var _0x1e721b=_0x4226b3['count'];var _0x4e44f4=_0x2c946b?0x0:_0x2a2a21[_0x7367('0x27')];var _0x1fa03a=_0x2c946b?_0x4226b3[_0x7367('0x28')]:_0x2a2a21[_0x7367('0x27')]+_0x2a2a21[_0x7367('0x26')];var _0x292b3a;if(_0x1fa03a>=_0x1e721b){_0x1fa03a=_0x1e721b;_0x292b3a=0xc8;}else{_0x292b3a=0xce;}_0xb5d3dd[_0x7367('0x23')](_0x292b3a);return _0xb5d3dd['set'](_0x7367('0x29'),_0x4e44f4+'-'+_0x1fa03a+'/'+_0x1e721b)['json'](_0x4226b3);}return null;};}function saveUpdates(_0x469522){return function(_0xa04d1f){if(_0xa04d1f){return _0xa04d1f['update'](_0x469522)[_0x7367('0x2a')](function(_0x5355b1){return _0x5355b1;});}return null;};}function removeEntity(_0x4f4a6d){return function(_0x171647){if(_0x171647){return _0x171647[_0x7367('0x2b')]()[_0x7367('0x2a')](function(){_0x4f4a6d[_0x7367('0x23')](0xcc)[_0x7367('0x22')]();});}};}function handleEntityNotFound(_0x168eb5){return function(_0x15f272){if(!_0x15f272){_0x168eb5['sendStatus'](0x194);}return _0x15f272;};}function handleError(_0x554b0a,_0x36ed08){_0x36ed08=_0x36ed08||0x1f4;return function(_0x3d86a5){logger['error'](_0x3d86a5['stack']);if(_0x3d86a5[_0x7367('0x2c')]){delete _0x3d86a5[_0x7367('0x2c')];}_0x554b0a['status'](_0x36ed08)['send'](_0x3d86a5);};}function getMustacheRender(_0x543c90,_0x57361c){return Mustache[_0x7367('0x2d')](_0x543c90,_[_0x7367('0x2e')](_0x57361c['body'],{'contact':_0x57361c[_0x7367('0x2f')],'message':_0x57361c[_0x7367('0x1f')],'agent':_0x57361c['agent'],'interaction':_0x57361c[_0x7367('0x30')],'account':_0x57361c['account']}))||'';}exports[_0x7367('0x31')]=function(_0x52d920,_0x831a39){var _0xae077c={};var _0x209c13=_[_0x7367('0x32')](db[_0x7367('0x33')][_0x7367('0x34')],function(_0x201042){return{'name':_0x201042['fieldName'],'type':_0x201042[_0x7367('0x35')][_0x7367('0x36')]};});_0xae077c=qs[_0x7367('0x37')](_0x209c13,_0x52d920);return interaction['findAll'](_0x7367('0x38'),_0x52d920[_0x7367('0x39')],_0x52d920[_0x7367('0x3a')],_0xae077c,_0x209c13)[_0x7367('0x2a')](respondWithFilteredResult(_0x831a39,_0xae077c))[_0x7367('0x21')](handleError(_0x831a39,null));};exports[_0x7367('0x3b')]=function(_0x57f915,_0x474ec3){var _0x3645a8={'raw':![],'where':{'id':_0x57f915[_0x7367('0x3c')]['id']}},_0x185d3f={};_0x185d3f[_0x7367('0x3d')]=_[_0x7367('0x3e')](db[_0x7367('0x33')]['rawAttributes']);_0x185d3f[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x57f915[_0x7367('0x39')]);_0x185d3f['filters']=_[_0x7367('0x3f')](_0x185d3f[_0x7367('0x3d')],_0x185d3f[_0x7367('0x39')]);_0x3645a8[_0x7367('0x40')]=_[_0x7367('0x3f')](_0x185d3f[_0x7367('0x3d')],qs['fields'](_0x57f915[_0x7367('0x39')]['fields']));_0x3645a8[_0x7367('0x40')]=_0x3645a8[_0x7367('0x40')]['length']?_0x3645a8['attributes']:_0x185d3f['model'];if(_0x57f915[_0x7367('0x39')][_0x7367('0x41')]){_0x3645a8[_0x7367('0x42')]=[{'all':!![]}];}_0x3645a8=_[_0x7367('0x2e')]({},_0x3645a8,_0x57f915['options']);return db['ChatInteraction']['find'](_0x3645a8)[_0x7367('0x2a')](handleEntityNotFound(_0x474ec3,null))['then'](respondWithResult(_0x474ec3,null))[_0x7367('0x21')](handleError(_0x474ec3,null));};exports['create']=function(_0x3337d4,_0x5b6ef2){return db[_0x7367('0x33')][_0x7367('0x43')](_0x3337d4[_0x7367('0x44')],{})[_0x7367('0x2a')](respondWithResult(_0x5b6ef2,0xc9))[_0x7367('0x21')](handleError(_0x5b6ef2,null));};exports[_0x7367('0x45')]=function(_0x4a6824,_0x4118bc){if(_0x4a6824['body']['id']){delete _0x4a6824[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x4a6824[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4118bc,null))[_0x7367('0x2a')](saveUpdates(_0x4a6824['body'],null))[_0x7367('0x2a')](respondWithResult(_0x4118bc,null))[_0x7367('0x21')](handleError(_0x4118bc,null));};exports[_0x7367('0x2b')]=function(_0x43b55c,_0xf242ae){return db['ChatInteraction'][_0x7367('0x46')]({'where':{'id':_0x43b55c['params']['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0xf242ae,null))[_0x7367('0x2a')](removeEntity(_0xf242ae,null))[_0x7367('0x21')](handleError(_0xf242ae,null));};exports[_0x7367('0x47')]=function(_0x19541b,_0x200cad){return db['ChatInteraction'][_0x7367('0x47')]()[_0x7367('0x2a')](respondWithResult(_0x200cad,null))['catch'](handleError(_0x200cad,null));};exports['createVidaooSession']=function(_0x426f98,_0x2d999a){var _0x18a2e4=_0x426f98[_0x7367('0x3c')]['id'];var _0x24c703;var _0x5d3953;var _0x1a3c2e;return db['ChatInteraction'][_0x7367('0x48')]({'where':{'id':_0x18a2e4}})[_0x7367('0x2a')](function(_0x4dea20){_0x24c703=_0x4dea20;return db[_0x7367('0x49')][_0x7367('0x48')]({'where':{'id':_0x4dea20[_0x7367('0x4a')]},'attributes':['id',_0x7367('0x4b'),_0x7367('0x4c'),_0x7367('0x4d'),_0x7367('0x4e'),_0x7367('0x4f')],'raw':!![]});})[_0x7367('0x2a')](function(_0xf59466){if(_0xf59466&&_0xf59466['vidaooApiKey']&&_0xf59466[_0x7367('0x4c')]){_0x5d3953=_0xf59466;var _0x54c626={'interaction':{'id':_0x18a2e4},'agent':{'id':_0x426f98[_0x7367('0x3a')]['id'],'name':_0x426f98[_0x7367('0x3a')][_0x7367('0x2c')],'fullname':_0x426f98['user']['fullname'],'email':_0x426f98['user']['email']},'contact':_0x426f98[_0x7367('0x44')][_0x7367('0x2f')],'account':_0x426f98[_0x7367('0x44')]['account']};var _0x1633c5={'rejectUnauthorized':![],'method':'POST','url':_0x7367('0x50'),'headers':{'X-APIKEY':_0xf59466['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x426f98[_0x7367('0x3a')]['email']],'buttons':null,'topic':_0x5d3953[_0x7367('0x4d')],'note':_[_0x7367('0x51')](_0x5d3953[_0x7367('0x4e')])?null:getMustacheRender(_0x5d3953[_0x7367('0x4e')],_0x54c626),'metadata':null},'redirect':_0x7367('0x52'),'json':!![]};try{if(!_[_0x7367('0x51')](_0x5d3953[_0x7367('0x4f')])){var _0x4b0baf=getMustacheRender(_0x5d3953[_0x7367('0x4f')],_0x54c626);var _0x260953=JSON[_0x7367('0x53')](_0x4b0baf);_0x1633c5[_0x7367('0x44')][_0x7367('0x54')]=_0x260953;}}catch(_0x469e07){throw new db[(_0x7367('0x55'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1633c5);}else{throw new db[(_0x7367('0x55'))][(_0x7367('0x56'))](_0x7367('0x57'));}})[_0x7367('0x2a')](function(_0x3d3d21){_0x1a3c2e=_0x3d3d21;if(_0x1a3c2e['id']){var _0x55492f={'body':_0x1a3c2e[_0x7367('0x58')],'ChatWebsiteId':_0x5d3953['id'],'ChatInteractionId':_0x24c703['id'],'direction':_0x7367('0x59'),'UserId':_0x426f98[_0x7367('0x3a')]['id']};return db['ChatMessage'][_0x7367('0x43')](_0x55492f,{});}else{throw new db['Sequelize']['ValidationError'](_0x7367('0x5a'));}})[_0x7367('0x2a')](function(){return _0x24c703[_0x7367('0x5b')]({'vidaooSessionId':_0x1a3c2e['id']});})['then'](respondWithResult(_0x2d999a,null))[_0x7367('0x21')](handleError(_0x2d999a,null));};exports[_0x7367('0x5c')]=function(_0x5f5517,_0x3f8def){if(_0x5f5517[_0x7367('0x44')]['id']){delete _0x5f5517[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')]['find']({'where':{'id':_0x5f5517[_0x7367('0x3c')]['id']},'include':[{'model':db[_0x7367('0x5d')],'as':_0x7367('0x5e')}]})['then'](handleEntityNotFound(_0x3f8def,null))[_0x7367('0x2a')](saveUpdates(_0x5f5517[_0x7367('0x44')],null))['then'](respondWithResult(_0x3f8def,null))[_0x7367('0x21')](handleError(_0x3f8def,null));};exports[_0x7367('0x5f')]=function(_0x5c0d43,_0x2b3be9){if(_0x5c0d43[_0x7367('0x44')]['id']){delete _0x5c0d43[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x5c0d43[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](function(_0x3eeaa0){if(!_0x3eeaa0){logger[_0x7367('0x1d')](_0x7367('0x60'),'abandon',0x194,_0x7367('0x61'));_0x2b3be9[_0x7367('0x62')](0x194);}else{if(_0x3eeaa0['UserId']){throw new db['Sequelize'][(_0x7367('0x56'))](_0x7367('0x63'));}}return _0x3eeaa0;})[_0x7367('0x2a')](function(_0x14c8b4){if(_0x14c8b4){return _0x14c8b4['update']({'closed':_0x5c0d43[_0x7367('0x44')][_0x7367('0x64')],'disposition':_0x5c0d43[_0x7367('0x44')][_0x7367('0x65')]})[_0x7367('0x2a')](function(_0x2d6ebd){return _0x2d6ebd;});}})[_0x7367('0x2a')](function(){return respondWithRpcPromise('AbandonInteraction',_0x7367('0x5f'),_0x5c0d43[_0x7367('0x44')],client9004);})[_0x7367('0x2a')](respondWithResult(_0x2b3be9,null))[_0x7367('0x21')](handleError(_0x2b3be9,null));};exports[_0x7367('0x66')]=function(_0x1c194,_0x5ce300){_0x1c194[_0x7367('0x44')]['name']=_0x1c194[_0x7367('0x67')][_0x7367('0x68')];_0x1c194['body'][_0x7367('0x69')]=_0x1c194[_0x7367('0x67')][_0x7367('0x6a')];_0x1c194[_0x7367('0x44')][_0x7367('0x35')]=_0x1c194[_0x7367('0x67')][_0x7367('0x6b')];return db[_0x7367('0x6c')][_0x7367('0x43')](_0x1c194[_0x7367('0x44')])['then'](respondWithResult(_0x5ce300,0xc9))[_0x7367('0x21')](handleError(_0x5ce300,null));};exports[_0x7367('0x6d')]=function(_0x5cae34,_0x34750b){return db[_0x7367('0x33')][_0x7367('0x48')]({'where':{'id':_0x5cae34[_0x7367('0x3c')]['id']},'raw':!![]})[_0x7367('0x2a')](handleEntityNotFound(_0x34750b,null))[_0x7367('0x2a')](function(_0x3c975a){if(_0x3c975a){if(_0x3c975a[_0x7367('0x64')]){return _0x34750b[_0x7367('0x23')](0x193)['json']({'status':0x193,'message':_0x7367('0x6e')});}return db[_0x7367('0x6c')][_0x7367('0x48')]({'where':{'id':_0x5cae34[_0x7367('0x39')][_0x7367('0x6f')]},'raw':!![]})[_0x7367('0x2a')](handleEntityNotFound(_0x34750b,null));}})[_0x7367('0x2a')](function(_0x49812c){if(_0x49812c){var _0xfad70c=_0x49812c[_0x7367('0x70')]!==null;var _0x2e08c6=path[_0x7367('0x71')](config['root'],_0x7367('0x72'));if(_0xfad70c){_0x2e08c6=path[_0x7367('0x71')](_0x2e08c6,'offline-chat/');}var _0xcdc967=path['join'](_0x2e08c6,_0x49812c[_0x7367('0x69')]);return _0x34750b['download'](_0xcdc967);}})[_0x7367('0x21')](handleError(_0x34750b,null));};exports[_0x7367('0x73')]=function(_0xc51323,_0x29d04e){var _0x2d4e26=null;var _0x46c264=null;var _0x222fcd=null;if(_0xc51323[_0x7367('0x44')]['id']){delete _0xc51323['body']['id'];}if(_0xc51323[_0x7367('0x44')]['mailTranscript']){_0x222fcd=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0x75'),util['format']('transcript-%s.txt',Date[_0x7367('0x76')]()));_0xc51323[_0x7367('0x44')][_0x7367('0x77')]=_0x222fcd;}return db[_0x7367('0x33')]['find']({'where':{'id':_0xc51323[_0x7367('0x3c')]['id']},'include':[{'model':db[_0x7367('0x78')],'as':_0x7367('0x79'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x7367('0x2a')](handleEntityNotFound(_0x29d04e,null))['then'](saveUpdates(_0xc51323[_0x7367('0x44')],null))[_0x7367('0x2a')](function(_0x289e30){if(_0x289e30){_0x2d4e26=_0x289e30;return db['ChatWebsite'][_0x7367('0x46')]({'where':{'id':_0x2d4e26[_0x7367('0x4a')]}});}})['then'](function(_0x8a9cd3){if(_0x8a9cd3){_0x46c264=_0x8a9cd3;return db[_0x7367('0x5d')][_0x7367('0x46')]({'where':{'id':_0x2d4e26[_0x7367('0x7a')]}});}})[_0x7367('0x2a')](function(_0x1f7baf){if(_0x1f7baf){if(_0x222fcd){var _0x3e439c=null;for(var _0x4d3c25=0x1;_0x4d3c25<_0x2d4e26['Messages']['length'];++_0x4d3c25){_0x3e439c=_0x2d4e26[_0x7367('0x79')][_0x4d3c25];var _0x37378a=_0x3e439c['UserId']?util[_0x7367('0x7b')](_0x7367('0x7c'),_0x46c264[_0x7367('0x7d')],_0x3e439c[_0x7367('0x7e')]):_0x7367('0x7f');var _0x5cfa26=_0xc51323[_0x7367('0x44')][_0x7367('0x80')]||util[_0x7367('0x7b')](_0x7367('0x7c'),_0x7367('0x81'),_0x3e439c[_0x7367('0x7a')]);switch(_0x46c264['agentIdentifier']){case'website_alias':_0x37378a=_0x3e439c[_0x7367('0x7e')]?util['format'](_0x7367('0x7c'),_0x46c264[_0x7367('0x7d')],_0x3e439c[_0x7367('0x7e')]):_0x7367('0x7f');break;case'agent_alias':_0x37378a=_0x3e439c[_0x7367('0x7e')]?_0x3e439c[_0x7367('0x82')][_0x7367('0x83')]||_0x3e439c[_0x7367('0x82')][_0x7367('0x84')]:'System';break;case'agent_fullname':_0x37378a=_0x3e439c[_0x7367('0x7e')]?_0x3e439c[_0x7367('0x82')][_0x7367('0x84')]:_0x7367('0x7f');break;default:_0x37378a=_0x3e439c[_0x7367('0x7e')]?util['format'](_0x7367('0x7c'),_0x46c264['agentAlias'],_0x3e439c['UserId']):_0x7367('0x7f');}var _0x5dc52c=util[_0x7367('0x7b')](_0x7367('0x85'),moment(_0x3e439c['createdAt'])[_0x7367('0x7b')](_0x7367('0x86')),_0x3e439c[_0x7367('0x87')]==='in'?_0x5cfa26:_0x37378a,_0x3e439c[_0x7367('0x44')]);if(!_0x3e439c[_0x7367('0x88')]){fs[_0x7367('0x89')](_0x222fcd,_0x5dc52c);}}return db[_0x7367('0x8a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x7367('0x8b')],'as':_0x7367('0x8c'),'raw':!![],'include':[{'model':db[_0x7367('0x8d')],'as':_0x7367('0x8d'),'raw':!![]}]}]});}}})[_0x7367('0x2a')](function(_0x4d50d2){if(!_0x4d50d2||!_0x4d50d2[_0x7367('0x8c')]||!_0xc51323[_0x7367('0x44')])return _0x2d4e26;var _0x534197=_0x4d50d2[_0x7367('0x8e')]();return respondWithRpcPromise('SendMail',_0x7367('0x8f'),{'account':_0x534197,'message':{'from':util[_0x7367('0x7b')](_0x7367('0x90'),_0x4d50d2[_0x7367('0x2c')],_0x4d50d2[_0x7367('0x91')]||_0x4d50d2[_0x7367('0x8c')][_0x7367('0x3a')]),'to':_0xc51323[_0x7367('0x44')][_0x7367('0x92')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc51323[_0x7367('0x44')][_0x7367('0x92')]),'attachments':[{'path':_0x222fcd}]}})[_0x7367('0x2a')](function(){return _0x2d4e26;})[_0x7367('0x21')](function(_0x55d378){logger[_0x7367('0x1d')](_0x55d378);});})['then'](respondWithStatusCode(_0x29d04e,0xc8))[_0x7367('0x21')](handleError(_0x29d04e,null));};exports[_0x7367('0x93')]=function(_0x2e299c,_0x2df8ae){return db['ChatMessage']['find']({'where':{'id':_0x2e299c[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x2df8ae,null))['then'](function(_0x5c75cd){if(_0x5c75cd){return _0x5c75cd['addMessage'](_0x2e299c[_0x7367('0x44')][_0x7367('0x94')],_[_0x7367('0x95')](_0x2e299c[_0x7367('0x44')],[_0x7367('0x94'),'id'])||{});}})[_0x7367('0x2a')](respondWithResult(_0x2df8ae,null))[_0x7367('0x21')](handleError(_0x2df8ae,null));};exports[_0x7367('0x96')]=function(_0x9bb23d,_0x581d96){var _0x4cf8c9={'raw':![],'where':{}};var _0x4f2ca5={};var _0x5cab53={'count':0x0,'rows':[]};return db[_0x7367('0x33')][_0x7367('0x48')]({'where':{'id':_0x9bb23d[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x581d96,null))[_0x7367('0x2a')](function(_0x21a26c){if(_0x21a26c){_0x4f2ca5['model']=_[_0x7367('0x3e')](db[_0x7367('0x78')][_0x7367('0x34')]);_0x4f2ca5[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x9bb23d[_0x7367('0x39')]);_0x4f2ca5['filters']=_['intersection'](_0x4f2ca5[_0x7367('0x3d')],_0x4f2ca5[_0x7367('0x39')]);_0x4cf8c9['attributes']=_[_0x7367('0x3f')](_0x4f2ca5[_0x7367('0x3d')],qs['fields'](_0x9bb23d[_0x7367('0x39')]['fields']));_0x4cf8c9['attributes']=_0x4cf8c9[_0x7367('0x40')][_0x7367('0x97')]?_0x4cf8c9['attributes']:_0x4f2ca5['model'];if(!_0x9bb23d['query'][_0x7367('0x98')](_0x7367('0x99'))){_0x4cf8c9['limit']=qs['limit'](_0x9bb23d[_0x7367('0x39')][_0x7367('0x26')]);_0x4cf8c9[_0x7367('0x27')]=qs['offset'](_0x9bb23d[_0x7367('0x39')][_0x7367('0x27')]);}_0x4cf8c9[_0x7367('0x9a')]=qs[_0x7367('0x9b')](_0x9bb23d['query'][_0x7367('0x9b')]);_0x4cf8c9[_0x7367('0x9c')]=qs[_0x7367('0x9d')](_[_0x7367('0x9e')](_0x9bb23d[_0x7367('0x39')],_0x4f2ca5['filters']));_0x4cf8c9[_0x7367('0x9c')][_0x7367('0x9f')]=_0x21a26c['id'];if(_0x9bb23d[_0x7367('0x39')][_0x7367('0xa0')]){_0x4cf8c9['where']=_['merge'](_0x4cf8c9[_0x7367('0x9c')],{'$or':_['map'](_0x4cf8c9[_0x7367('0x40')],function(_0x2ab2c6){var _0x8bbf4c={};_0x8bbf4c[_0x2ab2c6]={'$like':'%'+_0x9bb23d[_0x7367('0x39')][_0x7367('0xa0')]+'%'};return _0x8bbf4c;})});}if(_0x9bb23d[_0x7367('0x39')][_0x7367('0xa1')]){var _0x8386c9=_0x9bb23d[_0x7367('0x39')][_0x7367('0xa1')][_0x7367('0xa2')](',');var _0x534ba5={};_0x534ba5[_0x8386c9[0x0]]={'$gte':moment(_0x8386c9[0x1])['format'](_0x7367('0xa3'))};_0x4cf8c9[_0x7367('0x9c')]=_[_0x7367('0x2e')](_0x4cf8c9[_0x7367('0x9c')],_0x534ba5);}_0x4cf8c9=_[_0x7367('0x2e')]({},_0x4cf8c9,_0x9bb23d[_0x7367('0xa4')]);return db[_0x7367('0x78')]['count']({'where':_0x4cf8c9['where']})[_0x7367('0x2a')](function(_0x2690e4){_0x5cab53[_0x7367('0x28')]=_0x2690e4;if(_0x9bb23d[_0x7367('0x39')]['includeAll']){_0x4cf8c9[_0x7367('0x42')]=[{'all':!![]}];}return db['ChatMessage'][_0x7367('0xa5')](_0x4cf8c9);})[_0x7367('0x2a')](function(_0x2cc397){_0x5cab53['rows']=_0x2cc397;return _0x5cab53;});}})[_0x7367('0x2a')](respondWithFilteredResult(_0x581d96,_0x4cf8c9))[_0x7367('0x21')](handleError(_0x581d96,null));};exports[_0x7367('0xa6')]=function(_0x5e5388,_0x4470f8){var _0xd40b1a={'where':{}},_0x4bcef5={},_0x553ae9={'count':0x0,'rows':[]};return db[_0x7367('0x33')]['findOne']({'where':{'id':_0x5e5388[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4470f8,null))['then'](function(_0x463723){if(_0x463723){_0x4bcef5[_0x7367('0x3d')]=_['keys'](db['ChatMessage'][_0x7367('0x34')]);_0x4bcef5[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x5e5388[_0x7367('0x39')]);_0x4bcef5['filters']=_[_0x7367('0x3f')](_0x4bcef5[_0x7367('0x3d')],_0x4bcef5[_0x7367('0x39')]);_0xd40b1a[_0x7367('0x40')]=_[_0x7367('0x3f')](_0x4bcef5['model'],qs[_0x7367('0xa7')](_0x5e5388[_0x7367('0x39')]['fields']));_0xd40b1a[_0x7367('0x40')]=_0xd40b1a[_0x7367('0x40')][_0x7367('0x97')]?_0xd40b1a['attributes']:_0x4bcef5[_0x7367('0x3d')];if(!_0x5e5388[_0x7367('0x39')][_0x7367('0x98')](_0x7367('0x99'))){_0xd40b1a[_0x7367('0x26')]=qs[_0x7367('0x26')](_0x5e5388[_0x7367('0x39')][_0x7367('0x26')]);_0xd40b1a[_0x7367('0x27')]=qs[_0x7367('0x27')](_0x5e5388[_0x7367('0x39')][_0x7367('0x27')]);}_0xd40b1a[_0x7367('0x9a')]=qs['sort'](_0x5e5388['query']['sort']);_0xd40b1a[_0x7367('0x9c')]=qs['filters'](_['pick'](_0x5e5388[_0x7367('0x39')],_0x4bcef5[_0x7367('0x9d')]));_0xd40b1a[_0x7367('0x9c')][_0x7367('0x9f')]=_0x463723['id'];if(_0x5e5388[_0x7367('0x39')][_0x7367('0xa0')]){_0xd40b1a['where']=_[_0x7367('0x2e')](_0xd40b1a[_0x7367('0x9c')],{'$or':_[_0x7367('0x32')](_0xd40b1a[_0x7367('0x40')],function(_0x13fda0){var _0x2cdad6={};_0x2cdad6[_0x13fda0]={'$like':'%'+_0x5e5388['query']['filter']+'%'};return _0x2cdad6;})});}_0xd40b1a[_0x7367('0x9c')][_0x7367('0x88')]=![];if(_0x5e5388['query']['id']){_0xd40b1a[_0x7367('0x9c')]['id']={'$gt':_0x5e5388[_0x7367('0x39')]['id']};}_0xd40b1a=_['merge']({},_0xd40b1a,_0x5e5388[_0x7367('0xa4')]);return db['ChatMessage'][_0x7367('0x28')]({'where':_0xd40b1a['where']})[_0x7367('0x2a')](function(_0xf2288b){_0x553ae9[_0x7367('0x28')]=_0xf2288b;_0xd40b1a[_0x7367('0x42')]=[];if(_0x5e5388[_0x7367('0x39')][_0x7367('0xa8')]){_0xd40b1a[_0x7367('0x42')][_0x7367('0xa9')]({'model':db[_0x7367('0x82')],'as':_0x7367('0x82'),'attributes':['id',_0x7367('0x84'),'alias']});}if(_0x5e5388[_0x7367('0x39')][_0x7367('0x41')]){_0xd40b1a['include']=[{'all':!![]}];}return db[_0x7367('0x78')][_0x7367('0xa5')](_0xd40b1a);})[_0x7367('0x2a')](function(_0x3c8c72){_0x553ae9[_0x7367('0xaa')]=_0x3c8c72;return _0x553ae9;});}})[_0x7367('0x2a')](respondWithFilteredResult(_0x4470f8,_0xd40b1a))['catch'](handleError(_0x4470f8,null));};exports[_0x7367('0xab')]=function(_0x483564,_0xe12f0b){return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x483564[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0xe12f0b,null))[_0x7367('0x2a')](function(_0x2b1919){if(_0x2b1919){return _0x2b1919[_0x7367('0xac')](_0x483564[_0x7367('0x44')][_0x7367('0x94')],_[_0x7367('0x95')](_0x483564['body'],[_0x7367('0x94'),'id'])||{})[_0x7367('0xad')](function(){return db[_0x7367('0xae')][_0x7367('0xa5')]({'attributes':['id',_0x7367('0x2c'),_0x7367('0xaf')],'where':{'id':_0x483564['body'][_0x7367('0x94')]}});})[_0x7367('0x2a')](function(_0x4affb9){socket[_0x7367('0xb0')](_0x7367('0xb1'),{'id':Number(_0x483564[_0x7367('0x3c')]['id']),'tags':_0x4affb9||[]});return{'id':Number(_0x483564[_0x7367('0x3c')]['id']),'tags':_0x4affb9||[]};});}})[_0x7367('0x2a')](respondWithResult(_0xe12f0b,null))[_0x7367('0x21')](handleError(_0xe12f0b,null));};exports[_0x7367('0xb2')]=function(_0xc1a7ce,_0x4c6902){return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0xc1a7ce[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4c6902,null))['then'](function(_0x2c8f6c){if(_0x2c8f6c){return _0x2c8f6c[_0x7367('0xb2')](_0xc1a7ce[_0x7367('0x39')][_0x7367('0x94')]);}})[_0x7367('0x2a')](respondWithStatusCode(_0x4c6902,null))['catch'](handleError(_0x4c6902,null));};exports[_0x7367('0xb3')]=function(_0x4852dc,_0x4aecd4){var _0x4a75b7=moment()[_0x7367('0xb4')]()[_0x7367('0xb5')]();var _0xb33935=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),'files',_0x7367('0xb7'));var _0x570b57=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),_0x7367('0xb8'),_0x7367('0xb9'));var _0x33ef1e=path['join'](_0xb33935,_0x4a75b7);var _0x55673b=util[_0x7367('0x7b')](_0x7367('0xba'),_0x4852dc[_0x7367('0x3c')]['id'],_0x4a75b7);var _0x57d29c=path[_0x7367('0x71')](_0xb33935,_0x55673b);var _0x8e3402=[];_0x8e3402['push']({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x8e3402[_0x7367('0xa9')]({'model':db[_0x7367('0x5d')],'as':_0x7367('0x5e'),'attributes':['id',_0x7367('0xbb'),'lastName'],'raw':!![]});if(_0x4852dc['query'][_0x7367('0xb9')]){_0x8e3402[_0x7367('0xa9')]({'model':db[_0x7367('0x6c')],'as':_0x7367('0x6c'),'raw':!![]});}var _0x3cdb24=[{'model':db[_0x7367('0x78')],'as':'Messages','attributes':['id','body',_0x7367('0xbc'),_0x7367('0x87'),_0x7367('0x88'),_0x7367('0xbd')],'include':_0x8e3402}];_0x3cdb24[_0x7367('0xa9')]({'model':db['ChatWebsite'],'as':_0x7367('0xbe'),'attributes':['id','name']});_0x3cdb24[_0x7367('0xa9')]({'model':db['User'],'as':_0x7367('0xbf'),'attributes':['id',_0x7367('0x84')]});return db[_0x7367('0x33')]['find']({'where':{'id':_0x4852dc['params']['id']},'include':_0x3cdb24})[_0x7367('0x2a')](handleEntityNotFound(_0x4aecd4,null))[_0x7367('0x2a')](function(_0x52505c){if(_0x52505c){var _0x2717ee=_0x52505c[_0x7367('0xc0')]({'plain':!![]});fs['mkdirSync'](_0x33ef1e);var _0xf048dc={'channel':'Chat','account':_0x2717ee['Account'][_0x7367('0x2c')],'agent':_0x2717ee['Owner']?_0x2717ee['Owner'][_0x7367('0x84')]:_0x7367('0xc1'),'createdAt':moment(_0x2717ee[_0x7367('0xbc')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7367('0xb5')](),'closedAt':_0x2717ee[_0x7367('0x64')]?moment(_0x2717ee['closedAt'])[_0x7367('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2717ee[_0x7367('0x65')],'chatInfo':{'browser':_0x2717ee[_0x7367('0xc2')],'os':_0x2717ee['osName'],'referer':_0x2717ee['referer'],'customerIp':_0x2717ee[_0x7367('0xc3')],'customerPort':_0x2717ee[_0x7367('0xc4')]?_0x2717ee[_0x7367('0xc4')]:_0x7367('0xc1')},'messages':_(_0x2717ee[_0x7367('0x79')])[_0x7367('0xc5')]()[_0x7367('0xa0')]({'secret':![]})[_0x7367('0x32')](function(_0x36ee28){if(_0x36ee28[_0x7367('0x6c')]){var _0x2b4ac9=path[_0x7367('0x71')](_0x570b57,_0x36ee28[_0x7367('0x6c')][_0x7367('0x69')]);if(fs[_0x7367('0xc6')](_0x2b4ac9)){fs[_0x7367('0xc7')](_0x2b4ac9)[_0x7367('0xc8')](fs['createWriteStream'](path[_0x7367('0x71')](_0x33ef1e,_0x36ee28[_0x7367('0x6c')][_0x7367('0x69')])));}}return{'date':moment(_0x36ee28[_0x7367('0xbc')])[_0x7367('0x7b')](_0x7367('0xa3'))['toString'](),'sender':_0x36ee28[_0x7367('0x87')]===_0x7367('0x59')?_0x36ee28['User']?_0x36ee28[_0x7367('0x82')]['fullname']:_0x7367('0x7f'):_0x36ee28[_0x7367('0x5e')][_0x7367('0xbb')]+(_0x36ee28[_0x7367('0x5e')]['lastName']?'\x20'+_0x36ee28['Contact']['lastName']:''),'body':_0x36ee28[_0x7367('0x6c')]?_0x36ee28['Attachment'][_0x7367('0x69')]:_0x36ee28[_0x7367('0x44')],'direction':_0x36ee28[_0x7367('0x87')]===_0x7367('0x59')?'A':'C','secret':_0x36ee28[_0x7367('0x88')],'read':_0x36ee28[_0x7367('0xbd')],'attachment':_0x36ee28[_0x7367('0x6c')]};})['value']()};return ejs[_0x7367('0xc9')](path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),_0x7367('0xca'),'downloadInteraction.ejs'),{'interaction':_0xf048dc})[_0x7367('0x2a')](function(_0x5eda9e){var _0x257888=path[_0x7367('0x71')](_0x33ef1e,_0x7367('0xcb')+_0x2717ee['id']+'-'+_0x4a75b7+_0x7367('0xcc'));var _0xa5132a={'path':_0x257888,'channel':'Chat','interactionId':_0x2717ee['id']};return pdf['createPdfFromHTML'](_0x5eda9e,_0xa5132a);})[_0x7367('0x2a')](function(){return new Promise(function(_0x39118b,_0x239240){zipdir(_0x33ef1e,{'saveTo':_0x57d29c},function(_0x5c9273,_0x4dd063){if(_0x5c9273)return _0x239240(_0x5c9273);return _0x39118b(_0x4dd063);});})[_0x7367('0x2a')](function(){return new BPromise(function(_0xb5cba8,_0x646f1d){rimraf(_0x33ef1e,function(_0x3960c9){if(_0x3960c9)_0x646f1d(_0x3960c9);return _0xb5cba8();});});})[_0x7367('0x2a')](function(){return _0x4aecd4[_0x7367('0xb3')](_0x57d29c,_0x55673b,function(_0x53109e){if(_0x53109e){logger[_0x7367('0x1d')]('err',_0x53109e);}else{fs[_0x7367('0xcd')](_0x57d29c);}});});});}else{return _0x4aecd4[_0x7367('0x62')](0xc8);}})[_0x7367('0x21')](handleError(_0x4aecd4,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 64bed95..0d6fe73 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 _0x3e96=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save'];(function(_0x994307,_0x2e2762){var _0x503ced=function(_0x1c46f2){while(--_0x1c46f2){_0x994307['push'](_0x994307['shift']());}};_0x503ced(++_0x2e2762);}(_0x3e96,0x1c7));var _0x63e9=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x3e96[_0x29df9a];return _0x3a8e96;};'use strict';var EventEmitter=require(_0x63e9('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x63e9('0x1')];var ChatMessage=require(_0x63e9('0x2'))['db'][_0x63e9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x63e9('0x4'),'afterUpdate':_0x63e9('0x5'),'afterDestroy':_0x63e9('0x6')};function emitEvent(_0x24a618){return function(_0x55f85c,_0x465743,_0x950b16){_0x55f85c[_0x63e9('0x7')]({'attributes':['id'],'raw':!![]})[_0x63e9('0x8')](function(_0x3fae4b){_0x55f85c[_0x63e9('0x9')](_0x63e9('0xa'),_0x3fae4b[_0x63e9('0xb')](function(_0x31757d){return{'id':_0x31757d['id']};}));return ChatMessage[_0x63e9('0xc')]({'where':{'ChatInteractionId':_0x55f85c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x63e9('0x8')](function(_0x37992e){_0x55f85c[_0x63e9('0x9')](_0x63e9('0xd'),_0x37992e[_0x63e9('0xe')]);ChatInteractionEvents[_0x63e9('0xf')](_0x24a618+':'+_0x55f85c['id'],_0x55f85c);ChatInteractionEvents['emit'](_0x24a618,_0x55f85c);_0x950b16(null);})[_0x63e9('0x10')](_0x950b16(null));};}for(var e in events){if(events[_0x63e9('0x11')](e)){var event=events[e];ChatInteraction[_0x63e9('0x12')](e,emitEvent(event));}}module[_0x63e9('0x13')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x17d8=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17d8,0x110));var _0x817d=function(_0x42d485,_0x2c2c7c){_0x42d485=_0x42d485-0x0;var _0x65ba00=_0x17d8[_0x42d485];return _0x65ba00;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x817d('0x0'))['db'][_0x817d('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x817d('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x817d('0x3')](0x0);var events={'afterCreate':_0x817d('0x4'),'afterUpdate':_0x817d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x349f1c){return function(_0x3c1b40,_0x3713ad,_0x5ed4d7){_0x3c1b40[_0x817d('0x6')]({'attributes':['id'],'raw':!![]})[_0x817d('0x7')](function(_0x3c8a28){_0x3c1b40['setDataValue'](_0x817d('0x8'),_0x3c8a28[_0x817d('0x9')](function(_0x1d445e){return{'id':_0x1d445e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3c1b40['id'],'direction':'in','read':![]},'raw':!![]});})[_0x817d('0x7')](function(_0x41c7b1){_0x3c1b40[_0x817d('0xa')](_0x817d('0xb'),_0x41c7b1[_0x817d('0xc')]);ChatInteractionEvents['emit'](_0x349f1c+':'+_0x3c1b40['id'],_0x3c1b40);ChatInteractionEvents[_0x817d('0xd')](_0x349f1c,_0x3c1b40);_0x5ed4d7(null);})[_0x817d('0xe')](_0x5ed4d7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x817d('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index ee41cfa..325f276 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 _0x3be1=['changed','closed','format','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3be1,0xc7));var _0x13be=function(_0x1204e8,_0x56d4d2){_0x1204e8=_0x1204e8-0x0;var _0x4f7b9e=_0x3be1[_0x1204e8];return _0x4f7b9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13be('0x0'))(_0x13be('0x1'));var moment=require(_0x13be('0x2'));var BPromise=require(_0x13be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13be('0x4'));var rimraf=require(_0x13be('0x5'));var config=require(_0x13be('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x13be('0x7')]=function(_0x1dae8b,_0x54f4df){return _0x1dae8b[_0x13be('0x8')](_0x13be('0x9'),attributes,{'tableName':_0x13be('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d496d,_0x34dec1,_0x5c94ab){if(_0x2d496d[_0x13be('0xb')](_0x13be('0xc'))){_0x2d496d['closedAt']=moment()[_0x13be('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5c94ab(null,_0x2d496d);}},'charset':'utf8mb4','collate':_0x13be('0xe')});};
\ No newline at end of file
+var _0xb915=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0xb915,0xe1));var _0x5b91=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xb915[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0x5b91('0x0'));var util=require(_0x5b91('0x1'));var logger=require(_0x5b91('0x2'))('api');var moment=require(_0x5b91('0x3'));var BPromise=require(_0x5b91('0x4'));var rp=require(_0x5b91('0x5'));var fs=require('fs');var path=require(_0x5b91('0x6'));var rimraf=require('rimraf');var config=require(_0x5b91('0x7'));var attributes=require(_0x5b91('0x8'));module[_0x5b91('0x9')]=function(_0xefebf2,_0x5a819a){return _0xefebf2['define'](_0x5b91('0xa'),attributes,{'tableName':_0x5b91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f254c,_0x512132,_0x417639){if(_0x3f254c['changed']('closed')){_0x3f254c['closedAt']=moment()[_0x5b91('0xc')](_0x5b91('0xd'));}_0x417639(null,_0x3f254c);}},'charset':'utf8mb4','collate':_0x5b91('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 76e8d75..cdabc24 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 _0x3432=['code','message','result','catch','options','raw','attributes','limit','then','UpdateChatInteraction','debug','AddTagsToChatInteraction','ChatInteraction','find','where','ids','omit','body','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','socket.io-emitter','./chatInteraction.socket','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ff911,_0x1d2823){var _0x557082=function(_0x247a45){while(--_0x247a45){_0x1ff911['push'](_0x1ff911['shift']());}};_0x557082(++_0x1d2823);}(_0x3432,0x1c1));var _0x2343=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3432[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2343('0x0'));var util=require(_0x2343('0x1'));var moment=require(_0x2343('0x2'));var BPromise=require('bluebird');var rs=require(_0x2343('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2343('0x4'))['db'];var utils=require(_0x2343('0x5'));var logger=require('../../config/logger')(_0x2343('0x6'));var config=require('../../config/environment');var jayson=require(_0x2343('0x7'));var client=jayson['client'][_0x2343('0x8')]({'port':0x232a});config[_0x2343('0x9')]=_['defaults'](config[_0x2343('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2343('0xa'))(new Redis(config[_0x2343('0x9')]));require(_0x2343('0xb'))['register'](socket);function respondWithRpcPromise(_0x37bfdd,_0x1609cd,_0x26fe67){return new BPromise(function(_0x9c5f3b,_0x39d702){return client[_0x2343('0xc')](_0x37bfdd,_0x26fe67)['then'](function(_0x271f6b){logger[_0x2343('0xd')](_0x2343('0xe'),_0x1609cd,_0x2343('0xf'));logger['debug'](_0x2343('0x10'),_0x1609cd,'request\x20sent',JSON[_0x2343('0x11')](_0x271f6b));if(_0x271f6b[_0x2343('0x12')]){if(_0x271f6b[_0x2343('0x12')][_0x2343('0x13')]===0x1f4){logger[_0x2343('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1609cd,_0x271f6b[_0x2343('0x12')][_0x2343('0x14')]);return _0x39d702(_0x271f6b['error'][_0x2343('0x14')]);}logger[_0x2343('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1609cd,_0x271f6b[_0x2343('0x12')][_0x2343('0x14')]);return _0x9c5f3b(_0x271f6b['error'][_0x2343('0x14')]);}else{logger[_0x2343('0xd')](_0x2343('0xe'),_0x1609cd,_0x2343('0xf'));_0x9c5f3b(_0x271f6b[_0x2343('0x15')][_0x2343('0x14')]);}})[_0x2343('0x16')](function(_0x525829){logger[_0x2343('0x12')](_0x2343('0xe'),_0x1609cd,_0x525829);_0x39d702(_0x525829);});});}exports['UpdateChatInteraction']=function(_0x34665a){var _0x539412=this;return new Promise(function(_0x2d7b6e,_0x376174){return db['ChatInteraction']['update'](_0x34665a['body'],{'raw':_0x34665a[_0x2343('0x17')]?_0x34665a['options'][_0x2343('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34665a[_0x2343('0x17')]?_0x34665a[_0x2343('0x17')]['where']||null:null,'attributes':_0x34665a[_0x2343('0x17')]?_0x34665a[_0x2343('0x17')][_0x2343('0x19')]||null:null,'limit':_0x34665a[_0x2343('0x17')]?_0x34665a[_0x2343('0x17')][_0x2343('0x1a')]||null:null})[_0x2343('0x1b')](function(_0x4e0b28){logger[_0x2343('0xd')](_0x2343('0x1c'),_0x34665a);logger[_0x2343('0x1d')](_0x2343('0x1c'),_0x34665a,JSON[_0x2343('0x11')](_0x4e0b28));_0x2d7b6e(_0x4e0b28);})[_0x2343('0x16')](function(_0x843a6){logger['error'](_0x2343('0x1c'),_0x843a6['message'],_0x34665a);_0x376174(_0x539412['error'](0x1f4,_0x843a6['message']));});});};exports[_0x2343('0x1e')]=function(_0x2ccabe){return new Promise(function(_0x51449a,_0x54407e){return db[_0x2343('0x1f')][_0x2343('0x20')]({'where':_0x2ccabe[_0x2343('0x17')]?_0x2ccabe[_0x2343('0x17')][_0x2343('0x21')]||null:null})[_0x2343('0x1b')](function(_0x25b706){if(_0x25b706){return _0x25b706['addTags'](_0x2ccabe['body'][_0x2343('0x22')],_[_0x2343('0x23')](_0x2ccabe[_0x2343('0x24')],['ids','id'])||{});}})[_0x2343('0x25')](function(_0x43b6a6){logger[_0x2343('0xd')](_0x2343('0x26'),_0x2ccabe);logger[_0x2343('0x1d')](_0x2343('0x26'),_0x2ccabe,JSON[_0x2343('0x11')](_0x43b6a6));_0x51449a(_0x43b6a6);})['catch'](function(_0x477147){logger['error'](_0x2343('0x26'),_0x477147[_0x2343('0x14')],_0x2ccabe);_0x54407e(_this['error'](0x1f4,_0x477147[_0x2343('0x14')]));});});};
\ No newline at end of file
+var _0x8a3c=['AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','spread'];(function(_0x347573,_0x3a1f04){var _0x15a549=function(_0x1aef7d){while(--_0x1aef7d){_0x347573['push'](_0x347573['shift']());}};_0x15a549(++_0x3a1f04);}(_0x8a3c,0x1c4));var _0xc8a3=function(_0xcd4d8e,_0x1fc2fd){_0xcd4d8e=_0xcd4d8e-0x0;var _0x1c3c61=_0x8a3c[_0xcd4d8e];return _0x1c3c61;};'use strict';var _=require(_0xc8a3('0x0'));var util=require(_0xc8a3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc8a3('0x2'));var fs=require('fs');var Redis=require(_0xc8a3('0x3'));var db=require(_0xc8a3('0x4'))['db'];var utils=require(_0xc8a3('0x5'));var logger=require(_0xc8a3('0x6'))(_0xc8a3('0x7'));var config=require(_0xc8a3('0x8'));var jayson=require(_0xc8a3('0x9'));var client=jayson[_0xc8a3('0xa')][_0xc8a3('0xb')]({'port':0x232a});config[_0xc8a3('0xc')]=_[_0xc8a3('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc8a3('0xe'))(new Redis(config[_0xc8a3('0xc')]));require(_0xc8a3('0xf'))['register'](socket);function respondWithRpcPromise(_0x5c5e29,_0x5ddbb1,_0x84d7c6){return new BPromise(function(_0x5a7ed0,_0x4d9bb6){return client['request'](_0x5c5e29,_0x84d7c6)[_0xc8a3('0x10')](function(_0x499583){logger['info'](_0xc8a3('0x11'),_0x5ddbb1,'request\x20sent');logger[_0xc8a3('0x12')](_0xc8a3('0x13'),_0x5ddbb1,_0xc8a3('0x14'),JSON[_0xc8a3('0x15')](_0x499583));if(_0x499583[_0xc8a3('0x16')]){if(_0x499583[_0xc8a3('0x16')]['code']===0x1f4){logger[_0xc8a3('0x16')](_0xc8a3('0x11'),_0x5ddbb1,_0x499583[_0xc8a3('0x16')]['message']);return _0x4d9bb6(_0x499583[_0xc8a3('0x16')][_0xc8a3('0x17')]);}logger[_0xc8a3('0x16')](_0xc8a3('0x11'),_0x5ddbb1,_0x499583['error'][_0xc8a3('0x17')]);return _0x5a7ed0(_0x499583['error'][_0xc8a3('0x17')]);}else{logger[_0xc8a3('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5ddbb1,_0xc8a3('0x14'));_0x5a7ed0(_0x499583[_0xc8a3('0x19')][_0xc8a3('0x17')]);}})[_0xc8a3('0x1a')](function(_0x5a79cc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5ddbb1,_0x5a79cc);_0x4d9bb6(_0x5a79cc);});});}exports[_0xc8a3('0x1b')]=function(_0x57e150){var _0x2c81ab=this;return new Promise(function(_0x46e0b2,_0x551a1a){return db[_0xc8a3('0x1c')]['update'](_0x57e150[_0xc8a3('0x1d')],{'raw':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x20')]||null:null,'attributes':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x21')]||null:null,'limit':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x22')]||null:null})[_0xc8a3('0x10')](function(_0x37cc0c){logger['info']('UpdateChatInteraction',_0x57e150);logger[_0xc8a3('0x12')](_0xc8a3('0x1b'),_0x57e150,JSON[_0xc8a3('0x15')](_0x37cc0c));_0x46e0b2(_0x37cc0c);})['catch'](function(_0x45a1fb){logger[_0xc8a3('0x16')](_0xc8a3('0x1b'),_0x45a1fb[_0xc8a3('0x17')],_0x57e150);_0x551a1a(_0x2c81ab[_0xc8a3('0x16')](0x1f4,_0x45a1fb['message']));});});};exports[_0xc8a3('0x23')]=function(_0x599525){return new Promise(function(_0xe3b33a,_0x45c8e6){return db[_0xc8a3('0x1c')][_0xc8a3('0x24')]({'where':_0x599525[_0xc8a3('0x1e')]?_0x599525[_0xc8a3('0x1e')][_0xc8a3('0x20')]||null:null})[_0xc8a3('0x10')](function(_0x11b93b){if(_0x11b93b){return _0x11b93b[_0xc8a3('0x25')](_0x599525[_0xc8a3('0x1d')][_0xc8a3('0x26')],_['omit'](_0x599525[_0xc8a3('0x1d')],['ids','id'])||{});}})[_0xc8a3('0x27')](function(_0x404d60){logger[_0xc8a3('0x18')](_0xc8a3('0x28'),_0x599525);logger[_0xc8a3('0x12')]('AddTags',_0x599525,JSON['stringify'](_0x404d60));_0xe3b33a(_0x404d60);})[_0xc8a3('0x1a')](function(_0x1a6c41){logger['error'](_0xc8a3('0x28'),_0x1a6c41[_0xc8a3('0x17')],_0x599525);_0x45c8e6(_this[_0xc8a3('0x16')](0x1f4,_0x1a6c41[_0xc8a3('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f2ac622..9c91c54 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 _0x564c=['save','remove','update','emit','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x2f29a5,_0x486f4a){var _0x1bbfae=function(_0x22652e){while(--_0x22652e){_0x2f29a5['push'](_0x2f29a5['shift']());}};_0x1bbfae(++_0x486f4a);}(_0x564c,0xe7));var _0xc564=function(_0x200045,_0x4e5da1){_0x200045=_0x200045-0x0;var _0x566a8d=_0x564c[_0x200045];return _0x566a8d;};'use strict';var ChatInteractionEvents=require(_0xc564('0x0'));var events=[_0xc564('0x1'),_0xc564('0x2'),_0xc564('0x3')];function createListener(_0x363ba3,_0x5597df){return function(_0x58ad7b){_0x5597df[_0xc564('0x4')](_0x363ba3,_0x58ad7b);};}function removeListener(_0x38a70c,_0x1fceee){return function(){ChatInteractionEvents['removeListener'](_0x38a70c,_0x1fceee);};}exports[_0xc564('0x5')]=function(_0x32bbc9){for(var _0x147c03=0x0,_0x149eec=events[_0xc564('0x6')];_0x147c03<_0x149eec;_0x147c03++){var _0x19ca48=events[_0x147c03];var _0xe00518=createListener(_0xc564('0x7')+_0x19ca48,_0x32bbc9);ChatInteractionEvents['on'](_0x19ca48,_0xe00518);}};
\ No newline at end of file
+var _0x7376=['save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x2b92ec,_0x18e0e3){var _0x12be46=function(_0x18118b){while(--_0x18118b){_0x2b92ec['push'](_0x2b92ec['shift']());}};_0x12be46(++_0x18e0e3);}(_0x7376,0xa8));var _0x6737=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7376[_0x4b055c];return _0x4b62bb;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x6737('0x0'),_0x6737('0x1'),_0x6737('0x2')];function createListener(_0x3ad727,_0x45c267){return function(_0x2c9370){_0x45c267[_0x6737('0x3')](_0x3ad727,_0x2c9370);};}function removeListener(_0x5da8ea,_0x569bb8){return function(){ChatInteractionEvents[_0x6737('0x4')](_0x5da8ea,_0x569bb8);};}exports['register']=function(_0x1d0d44){for(var _0x12b8bc=0x0,_0x17eae0=events[_0x6737('0x5')];_0x12b8bc<_0x17eae0;_0x12b8bc++){var _0x579b64=events[_0x12b8bc];var _0x184a47=createListener(_0x6737('0x6')+_0x579b64,_0x1d0d44);ChatInteractionEvents['on'](_0x579b64,_0x184a47);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 0b4803a..1d2bce2 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 _0x4a4f=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','getMyMessages','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','replace','/:id/attachment_upload','single','file','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','customUpdate','/:id/abandon','close','chatinteraction:destroy','destroy','delete','exports','multer','util'];(function(_0x256bfc,_0x26e6ff){var _0x5cdd26=function(_0x51b296){while(--_0x51b296){_0x256bfc['push'](_0x256bfc['shift']());}};_0x5cdd26(++_0x26e6ff);}(_0x4a4f,0x1a5));var _0xf4a4=function(_0xb6dab7,_0x209af0){_0xb6dab7=_0xb6dab7-0x0;var _0x9d51a7=_0x4a4f[_0xb6dab7];return _0x9d51a7;};'use strict';var multer=require(_0xf4a4('0x0'));var util=require(_0xf4a4('0x1'));var path=require('path');var timeout=require(_0xf4a4('0x2'));var express=require(_0xf4a4('0x3'));var router=express['Router']();var fs_extra=require(_0xf4a4('0x4'));var auth=require(_0xf4a4('0x5'));var interaction=require(_0xf4a4('0x6'));var config=require(_0xf4a4('0x7'));var controller=require(_0xf4a4('0x8'));router[_0xf4a4('0x9')]('/',auth[_0xf4a4('0xa')](),controller[_0xf4a4('0xb')]);router[_0xf4a4('0x9')](_0xf4a4('0xc'),auth[_0xf4a4('0xa')](),controller['describe']);router[_0xf4a4('0x9')]('/:id',auth[_0xf4a4('0xd')](),controller['show']);router[_0xf4a4('0x9')](_0xf4a4('0xe'),auth[_0xf4a4('0xd')](),controller[_0xf4a4('0xf')]);router[_0xf4a4('0x9')]('/:id/messages',auth[_0xf4a4('0xa')](),controller['getMessages']);router[_0xf4a4('0x9')]('/:id/my_messages',auth[_0xf4a4('0xd')](),controller[_0xf4a4('0x10')]);router[_0xf4a4('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xf4a4('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf4a4('0x11')](_0xf4a4('0x12'),auth[_0xf4a4('0xa')](),controller[_0xf4a4('0x13')]);var upload=multer({'storage':multer[_0xf4a4('0x14')]({'destination':function(_0x3cbf7e,_0x4befe6,_0x433b87){_0x433b87(null,path['join'](config[_0xf4a4('0x15')],_0xf4a4('0x16')));},'filename':function(_0x2f6823,_0xc8bd3f,_0x50b35d){_0x50b35d(null,util[_0xf4a4('0x17')](_0xf4a4('0x18'),Date['now'](),_0xc8bd3f['originalname'][_0xf4a4('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf4a4('0x1a'),upload[_0xf4a4('0x1b')](_0xf4a4('0x1c')),controller['attachmentUpload']);router[_0xf4a4('0x11')](_0xf4a4('0x1d'),auth[_0xf4a4('0xd')](),controller[_0xf4a4('0x1e')]);router['post'](_0xf4a4('0x1f'),auth[_0xf4a4('0xa')](),interaction[_0xf4a4('0x20')](_0xf4a4('0x21'),_0xf4a4('0x22')),controller[_0xf4a4('0x23')]);router[_0xf4a4('0x24')](_0xf4a4('0x25'),auth[_0xf4a4('0xa')](),interaction[_0xf4a4('0x20')](_0xf4a4('0x21'),_0xf4a4('0x26')),controller[_0xf4a4('0x27')]);router[_0xf4a4('0x24')]('/:id/custom_update',controller[_0xf4a4('0x28')]);router[_0xf4a4('0x24')](_0xf4a4('0x29'),auth[_0xf4a4('0xd')](),controller['abandon']);router['put']('/:id/close',controller[_0xf4a4('0x2a')]);router['delete'](_0xf4a4('0x25'),auth['isAuthenticated'](),interaction[_0xf4a4('0x20')]('chat',_0xf4a4('0x2b')),controller[_0xf4a4('0x2c')]);router[_0xf4a4('0x2d')](_0xf4a4('0x1f'),auth[_0xf4a4('0xa')](),controller['removeTags']);module[_0xf4a4('0x2e')]=router;
\ No newline at end of file
+var _0x8dd8=['update','put','/:id/custom_update','/:id/abandon','abandon','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x5b67bd,_0x2bf7ef){var _0x2b795a=function(_0x124fea){while(--_0x124fea){_0x5b67bd['push'](_0x5b67bd['shift']());}};_0x2b795a(++_0x2bf7ef);}(_0x8dd8,0x188));var _0x88dd=function(_0x585ae6,_0x25aa5f){_0x585ae6=_0x585ae6-0x0;var _0x87f16b=_0x8dd8[_0x585ae6];return _0x87f16b;};'use strict';var multer=require(_0x88dd('0x0'));var util=require('util');var path=require(_0x88dd('0x1'));var timeout=require(_0x88dd('0x2'));var express=require(_0x88dd('0x3'));var router=express[_0x88dd('0x4')]();var fs_extra=require(_0x88dd('0x5'));var auth=require(_0x88dd('0x6'));var interaction=require(_0x88dd('0x7'));var config=require(_0x88dd('0x8'));var controller=require(_0x88dd('0x9'));router[_0x88dd('0xa')]('/',auth[_0x88dd('0xb')](),controller[_0x88dd('0xc')]);router[_0x88dd('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x88dd('0xd')]);router[_0x88dd('0xa')](_0x88dd('0xe'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x10')]);router[_0x88dd('0xa')](_0x88dd('0x11'),auth[_0x88dd('0xf')](),controller['attachmentDownload']);router[_0x88dd('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x88dd('0xa')](_0x88dd('0x12'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x13')]);router[_0x88dd('0xa')](_0x88dd('0x14'),auth[_0x88dd('0xb')](),controller[_0x88dd('0x15')]);router[_0x88dd('0x16')]('/',auth['isAuthenticated'](),controller[_0x88dd('0x17')]);router[_0x88dd('0x16')](_0x88dd('0x18'),auth[_0x88dd('0xb')](),controller[_0x88dd('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x388fca,_0xdb5b02,_0x7572d4){_0x7572d4(null,path[_0x88dd('0x1a')](config[_0x88dd('0x1b')],_0x88dd('0x1c')));},'filename':function(_0x4407c3,_0x24a9be,_0x24e59d){_0x24e59d(null,util[_0x88dd('0x1d')](_0x88dd('0x1e'),Date[_0x88dd('0x1f')](),_0x24a9be[_0x88dd('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x88dd('0x21'),upload[_0x88dd('0x22')](_0x88dd('0x23')),controller['attachmentUpload']);router[_0x88dd('0x16')]('/:id/messages',auth[_0x88dd('0xf')](),controller['addMessage']);router['post'](_0x88dd('0x24'),auth[_0x88dd('0xb')](),interaction[_0x88dd('0x25')](_0x88dd('0x26'),_0x88dd('0x27')),controller['addTags']);router['put']('/:id',auth[_0x88dd('0xb')](),interaction['tracked'](_0x88dd('0x26'),'chatinteraction:update'),controller[_0x88dd('0x28')]);router[_0x88dd('0x29')](_0x88dd('0x2a'),controller['customUpdate']);router['put'](_0x88dd('0x2b'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x2c')]);router[_0x88dd('0x29')]('/:id/close',controller['close']);router[_0x88dd('0x2d')](_0x88dd('0xe'),auth[_0x88dd('0xb')](),interaction[_0x88dd('0x25')](_0x88dd('0x26'),'chatinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x88dd('0xb')](),controller[_0x88dd('0x2e')]);module[_0x88dd('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 9e38a22..b8e6563 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 _0xef83=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x4989ce,_0x2c420d){var _0x4d5c47=function(_0x596edf){while(--_0x596edf){_0x4989ce['push'](_0x4989ce['shift']());}};_0x4d5c47(++_0x2c420d);}(_0xef83,0x161));var _0x3ef8=function(_0x1fc3aa,_0x1b92fd){_0x1fc3aa=_0x1fc3aa-0x0;var _0x11dd40=_0xef83[_0x1fc3aa];return _0x11dd40;};'use strict';var Sequelize=require('sequelize');module[_0x3ef8('0x0')]={'body':{'type':Sequelize[_0x3ef8('0x1')](_0x3ef8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3ef8('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3ef8('0x4')]}};
\ No newline at end of file
+var _0xc65c=['TEXT','medium','BOOLEAN','sequelize','exports'];(function(_0x3e0475,_0x4ee34c){var _0x1547c3=function(_0x415a52){while(--_0x415a52){_0x3e0475['push'](_0x3e0475['shift']());}};_0x1547c3(++_0x4ee34c);}(_0xc65c,0x11b));var _0xcc65=function(_0x5197eb,_0x745e93){_0x5197eb=_0x5197eb-0x0;var _0x19da1f=_0xc65c[_0x5197eb];return _0x19da1f;};'use strict';var Sequelize=require(_0xcc65('0x0'));module[_0xcc65('0x1')]={'body':{'type':Sequelize[_0xcc65('0x2')](_0xcc65('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcc65('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 87511eb..144525c 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 _0x3ac8=['agent','user','fullname','online','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','filter','resourceId','push','createdAt','FromId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','index','map','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','ChatInternalMessage','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0x3ac8,0x1d4));var _0x83ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x83ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83ac('0x1'));var jsonpatch=require(_0x83ac('0x2'));var rp=require(_0x83ac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x83ac('0x4'));var util=require(_0x83ac('0x5'));var path=require(_0x83ac('0x6'));var sox=require(_0x83ac('0x7'));var csv=require(_0x83ac('0x8'));var ejs=require(_0x83ac('0x9'));var fs=require('fs');var fs_extra=require(_0x83ac('0xa'));var _=require(_0x83ac('0xb'));var squel=require(_0x83ac('0xc'));var crypto=require(_0x83ac('0xd'));var jsforce=require(_0x83ac('0xe'));var deskjs=require(_0x83ac('0xf'));var toCsv=require(_0x83ac('0x8'));var querystring=require(_0x83ac('0x10'));var Papa=require(_0x83ac('0x11'));var Redis=require(_0x83ac('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x83ac('0x13'));var as=require(_0x83ac('0x14'));var hardwareService=require(_0x83ac('0x15'));var logger=require('../../config/logger')(_0x83ac('0x16'));var utils=require(_0x83ac('0x17'));var config=require(_0x83ac('0x18'));var licenseUtil=require(_0x83ac('0x19'));var db=require(_0x83ac('0x1a'))['db'];config[_0x83ac('0x1b')]=_[_0x83ac('0x1c')](config[_0x83ac('0x1b')],{'host':_0x83ac('0x1d'),'port':0x18eb});var socket=require(_0x83ac('0x1e'))(new Redis(config[_0x83ac('0x1b')]));require(_0x83ac('0x1f'))['register'](socket);function respondWithStatusCode(_0x5db060,_0x34d5a1){_0x34d5a1=_0x34d5a1||0xcc;return function(_0x5a9b3a){if(_0x5a9b3a){return _0x5db060['sendStatus'](_0x34d5a1);}return _0x5db060[_0x83ac('0x20')](_0x34d5a1)[_0x83ac('0x21')]();};}function respondWithResult(_0x873d48,_0x5e7463){_0x5e7463=_0x5e7463||0xc8;return function(_0x3d6b52){if(_0x3d6b52){return _0x873d48['status'](_0x5e7463)[_0x83ac('0x22')](_0x3d6b52);}};}function respondWithFilteredResult(_0x2127b9,_0x50a88d){return function(_0x40824d){if(_0x40824d){var _0x13f03a=typeof _0x50a88d[_0x83ac('0x23')]===_0x83ac('0x24')&&typeof _0x50a88d[_0x83ac('0x25')]===_0x83ac('0x24');var _0x254815=_0x40824d[_0x83ac('0x26')];var _0x103ed8=_0x13f03a?0x0:_0x50a88d[_0x83ac('0x23')];var _0x5f4a38=_0x13f03a?_0x40824d[_0x83ac('0x26')]:_0x50a88d[_0x83ac('0x23')]+_0x50a88d['limit'];var _0x42d2e1;if(_0x5f4a38>=_0x254815){_0x5f4a38=_0x254815;_0x42d2e1=0xc8;}else{_0x42d2e1=0xce;}_0x2127b9[_0x83ac('0x20')](_0x42d2e1);return _0x2127b9['set'](_0x83ac('0x27'),_0x103ed8+'-'+_0x5f4a38+'/'+_0x254815)[_0x83ac('0x22')](_0x40824d);}return null;};}function patchUpdates(_0x1e4db8){return function(_0x4dc24c){try{jsonpatch[_0x83ac('0x28')](_0x4dc24c,_0x1e4db8,!![]);}catch(_0x65e78d){return BPromise[_0x83ac('0x29')](_0x65e78d);}return _0x4dc24c[_0x83ac('0x2a')]();};}function saveUpdates(_0x230feb,_0x49d514){return function(_0x36b13b){if(_0x36b13b){return _0x36b13b['update'](_0x230feb)[_0x83ac('0x2b')](function(_0x4a8173){return _0x4a8173;});}return null;};}function removeEntity(_0x4bb49d,_0x4d9b57){return function(_0x5bf2d2){if(_0x5bf2d2){return _0x5bf2d2[_0x83ac('0x2c')]()[_0x83ac('0x2b')](function(){_0x4bb49d[_0x83ac('0x20')](0xcc)[_0x83ac('0x21')]();});}};}function handleEntityNotFound(_0x338bac,_0x395b68){return function(_0x404d76){if(!_0x404d76){_0x338bac[_0x83ac('0x2d')](0x194);}return _0x404d76;};}function handleError(_0x392c6b,_0x189103){_0x189103=_0x189103||0x1f4;return function(_0x53b4cf){logger[_0x83ac('0x2e')](_0x53b4cf['stack']);if(_0x53b4cf[_0x83ac('0x2f')]){delete _0x53b4cf[_0x83ac('0x2f')];}_0x392c6b[_0x83ac('0x20')](_0x189103)['send'](_0x53b4cf);};}exports[_0x83ac('0x30')]=function(_0x12e4b6,_0x2275a2){var _0x13d300={},_0x239910={},_0x5512cc={'count':0x0,'rows':[]};var _0x2637ed=_[_0x83ac('0x31')](db['ChatInternalMessage']['rawAttributes'],function(_0x544672){return{'name':_0x544672[_0x83ac('0x32')],'type':_0x544672[_0x83ac('0x33')]['key']};});_0x239910['model']=_[_0x83ac('0x31')](_0x2637ed,_0x83ac('0x2f'));_0x239910[_0x83ac('0x34')]=_['keys'](_0x12e4b6[_0x83ac('0x34')]);_0x239910[_0x83ac('0x35')]=_[_0x83ac('0x36')](_0x239910[_0x83ac('0x37')],_0x239910[_0x83ac('0x34')]);_0x13d300[_0x83ac('0x38')]=_[_0x83ac('0x36')](_0x239910[_0x83ac('0x37')],qs[_0x83ac('0x39')](_0x12e4b6[_0x83ac('0x34')][_0x83ac('0x39')]));_0x13d300['attributes']=_0x13d300[_0x83ac('0x38')][_0x83ac('0x3a')]?_0x13d300[_0x83ac('0x38')]:_0x239910['model'];if(!_0x12e4b6['query'][_0x83ac('0x3b')]('nolimit')){_0x13d300[_0x83ac('0x25')]=qs[_0x83ac('0x25')](_0x12e4b6[_0x83ac('0x34')][_0x83ac('0x25')]);_0x13d300[_0x83ac('0x23')]=qs[_0x83ac('0x23')](_0x12e4b6['query'][_0x83ac('0x23')]);}_0x13d300[_0x83ac('0x3c')]=qs[_0x83ac('0x3d')](_0x12e4b6[_0x83ac('0x34')]['sort']);_0x13d300['where']=qs[_0x83ac('0x35')](_[_0x83ac('0x3e')](_0x12e4b6['query'],_0x239910[_0x83ac('0x35')]),_0x2637ed);if(_0x12e4b6['query']['filter']){_0x13d300[_0x83ac('0x3f')]=_[_0x83ac('0x40')](_0x13d300[_0x83ac('0x3f')],{'$or':_[_0x83ac('0x31')](_0x2637ed,function(_0x2b8621){if(_0x2b8621[_0x83ac('0x33')]!==_0x83ac('0x41')){var _0x258df4={};_0x258df4[_0x2b8621['name']]={'$like':'%'+_0x12e4b6[_0x83ac('0x34')]['filter']+'%'};return _0x258df4;}})});}_0x13d300=_[_0x83ac('0x40')]({},_0x13d300,_0x12e4b6[_0x83ac('0x42')]);var _0x518d38={'where':_0x13d300[_0x83ac('0x3f')]};return db[_0x83ac('0x43')][_0x83ac('0x26')](_0x518d38)['then'](function(_0x127242){_0x5512cc[_0x83ac('0x26')]=_0x127242;if(_0x12e4b6[_0x83ac('0x34')][_0x83ac('0x44')]){_0x13d300['include']=[{'all':!![]}];}return db[_0x83ac('0x43')][_0x83ac('0x45')](_0x13d300);})[_0x83ac('0x2b')](function(_0x12020e){_0x5512cc[_0x83ac('0x46')]=_0x12020e;return _0x5512cc;})[_0x83ac('0x2b')](respondWithFilteredResult(_0x2275a2,_0x13d300))[_0x83ac('0x47')](handleError(_0x2275a2,null));};exports[_0x83ac('0x48')]=function(_0x50deae,_0x1aacd0){var _0x1c05da={'raw':!![],'where':{'id':_0x50deae[_0x83ac('0x49')]['id']}},_0xb0a04e={};_0xb0a04e['model']=_[_0x83ac('0x4a')](db[_0x83ac('0x43')][_0x83ac('0x4b')]);_0xb0a04e['query']=_[_0x83ac('0x4a')](_0x50deae['query']);_0xb0a04e[_0x83ac('0x35')]=_[_0x83ac('0x36')](_0xb0a04e[_0x83ac('0x37')],_0xb0a04e[_0x83ac('0x34')]);_0x1c05da[_0x83ac('0x38')]=_['intersection'](_0xb0a04e[_0x83ac('0x37')],qs[_0x83ac('0x39')](_0x50deae['query']['fields']));_0x1c05da[_0x83ac('0x38')]=_0x1c05da[_0x83ac('0x38')][_0x83ac('0x3a')]?_0x1c05da[_0x83ac('0x38')]:_0xb0a04e[_0x83ac('0x37')];if(_0x50deae[_0x83ac('0x34')][_0x83ac('0x44')]){_0x1c05da[_0x83ac('0x4c')]=[{'all':!![]}];}_0x1c05da=_['merge']({},_0x1c05da,_0x50deae['options']);return db[_0x83ac('0x43')][_0x83ac('0x4d')](_0x1c05da)['then'](handleEntityNotFound(_0x1aacd0,null))[_0x83ac('0x2b')](respondWithResult(_0x1aacd0,null))['catch'](handleError(_0x1aacd0,null));};exports['create']=function(_0x2aed74,_0x5b3182){return db[_0x83ac('0x43')][_0x83ac('0x4e')](_0x2aed74[_0x83ac('0x4f')],{})[_0x83ac('0x2b')](respondWithResult(_0x5b3182,0xc9))[_0x83ac('0x47')](handleError(_0x5b3182,null));};exports['update']=function(_0x1292cf,_0x2e62f4){if(_0x1292cf[_0x83ac('0x4f')]['id']){delete _0x1292cf[_0x83ac('0x4f')]['id'];}return db[_0x83ac('0x43')][_0x83ac('0x4d')]({'where':{'id':_0x1292cf[_0x83ac('0x49')]['id']}})[_0x83ac('0x2b')](handleEntityNotFound(_0x2e62f4,null))[_0x83ac('0x2b')](saveUpdates(_0x1292cf[_0x83ac('0x4f')],null))[_0x83ac('0x2b')](respondWithResult(_0x2e62f4,null))[_0x83ac('0x47')](handleError(_0x2e62f4,null));};exports[_0x83ac('0x2c')]=function(_0x115b79,_0x1db189){return db[_0x83ac('0x43')][_0x83ac('0x4d')]({'where':{'id':_0x115b79['params']['id']}})['then'](handleEntityNotFound(_0x1db189,null))[_0x83ac('0x2b')](removeEntity(_0x1db189,null))[_0x83ac('0x47')](handleError(_0x1db189,null));};exports['describe']=function(_0x31b004,_0x243fbd){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x243fbd,null))['catch'](handleError(_0x243fbd,null));};function wrapUser(_0x3d1667){return function(_0xb5a1e){var _0x436f09=_0x3d1667[_0x83ac('0x50')]({'plain':!![]});_0x436f09[_0x83ac('0x51')]=[];if(_0xb5a1e){_0x436f09[_0x83ac('0x52')]=_0xb5a1e['createdAt'];_0x436f09['lastMessage']=_0xb5a1e;}else{_0x436f09[_0x83ac('0x52')]=moment(0x0)[_0x83ac('0x53')](_0x83ac('0x54'));_0x436f09[_0x83ac('0x55')]={};}return _0x436f09;};}exports['getUsers']=function(_0x347d6e,_0x50ff2c,_0x4dda24){var _0x45b505=[];return db[_0x83ac('0x56')][_0x83ac('0x45')]({'where':{'role':[_0x83ac('0x57'),'admin',_0x83ac('0x58')]},'attributes':['id',_0x83ac('0x59'),_0x83ac('0x2f'),'role','userpic','internal',_0x83ac('0x5a'),'lastLoginAt','allowmessenger',_0x83ac('0x5b')],'order':qs['sort'](_0x83ac('0x5c')),'include':[{'model':db[_0x83ac('0x5d')],'as':_0x83ac('0x5e'),'attributes':['id',_0x83ac('0x2f'),_0x83ac('0x33')],'through':{'attributes':[]}}]})[_0x83ac('0x2b')](function(_0x3aa34e){if(_0x3aa34e){var _0x5e642a=_0x347d6e[_0x83ac('0x58')][_0x83ac('0x50')]({'plain':!![]});if(!_0x5e642a)throw new Error(_0x83ac('0x5f'));if(_0x5e642a[_0x83ac('0x60')]==='user'){return db[_0x83ac('0x61')][_0x83ac('0x4d')]({'where':{'name':_0x83ac('0x62'),'userProfileId':_0x5e642a[_0x83ac('0x63')]},'raw':!![]})['then'](function(_0x7b6b94){if(_0x7b6b94){if(_0x7b6b94[_0x83ac('0x64')]===0x0){return db[_0x83ac('0x65')]['findAll']({'where':{'sectionId':_0x7b6b94['id']},'raw':!![]})[_0x83ac('0x2b')](function(_0x4f969f){var _0x207a77=[];if(_[_0x83ac('0x66')](_0x4f969f)){_0x207a77=_[_0x83ac('0x67')](_0x3aa34e,function(_0x27b815){if(_0x27b815[_0x83ac('0x60')]!==_0x83ac('0x57')){return _0x27b815;}});return _0x207a77;}else{for(var _0x3fc14c=0x0;_0x3fc14c<_0x3aa34e['length'];_0x3fc14c++){var _0x1b13f7=_0x3aa34e[_0x3fc14c];if(_0x1b13f7[_0x83ac('0x60')]===_0x83ac('0x57')){var _0x5b180b=_[_0x83ac('0x4d')](_0x4f969f,function(_0x113577){return _0x113577[_0x83ac('0x68')]===_0x1b13f7['id'];});if(_0x5b180b)_0x207a77[_0x83ac('0x69')](_0x1b13f7);}else{_0x207a77[_0x83ac('0x69')](_0x1b13f7);}}return _0x207a77;}});}else{return _0x3aa34e;}}else{var _0x574904=_[_0x83ac('0x67')](_0x3aa34e,function(_0x4fe3b4){if(_0x4fe3b4[_0x83ac('0x60')]!==_0x83ac('0x57')){return _0x4fe3b4;}});return _0x574904;}});}else{return _0x3aa34e;}}})[_0x83ac('0x2b')](function(_0x22f1bd){var _0x5ac14d=[];if(_0x22f1bd){_0x45b505=_0x22f1bd;for(var _0x4fe513=0x0;_0x4fe513<_0x22f1bd['length'];_0x4fe513+=0x1){_0x45b505[_0x4fe513]['messages']=[];_0x5ac14d[_0x83ac('0x69')](db[_0x83ac('0x43')][_0x83ac('0x4d')]({'where':{'FromId':[_0x347d6e[_0x83ac('0x58')]['id'],_0x22f1bd[_0x4fe513]['id']],'ToId':[_0x347d6e[_0x83ac('0x58')]['id'],_0x22f1bd[_0x4fe513]['id']],'ChatGroupId':null},'attributes':['id',_0x83ac('0x6a'),_0x83ac('0x6b'),'ToId',_0x83ac('0x6c'),_0x83ac('0x4f')],'order':qs['sort'](_0x83ac('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x83ac('0x2b')](wrapUser(_0x22f1bd[_0x4fe513])));}return BPromise[_0x83ac('0x6e')](_0x5ac14d);}return[];})[_0x83ac('0x2b')](function(_0x2795f5){return{'rows':_0x2795f5,'count':_0x2795f5[_0x83ac('0x3a')]};})['then'](respondWithResult(_0x50ff2c,null))[_0x83ac('0x47')](handleError(_0x50ff2c,null));};
\ No newline at end of file
+var _0xc879=['update','destroy','stack','name','index','map','fieldName','query','filters','intersection','attributes','model','fields','length','nolimit','order','where','pick','filter','merge','type','VIRTUAL','ChatInternalMessage','then','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','online','lastLoginAt','sort','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x6595d5,_0x3f84e1){var _0x1b7304=function(_0x44f4f8){while(--_0x44f4f8){_0x6595d5['push'](_0x6595d5['shift']());}};_0x1b7304(++_0x3f84e1);}(_0xc879,0xae));var _0x9c87=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xc879[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0x9c87('0x0'));var rimraf=require(_0x9c87('0x1'));var zipdir=require(_0x9c87('0x2'));var jsonpatch=require(_0x9c87('0x3'));var rp=require('request-promise');var moment=require(_0x9c87('0x4'));var BPromise=require(_0x9c87('0x5'));var Mustache=require('mustache');var util=require(_0x9c87('0x6'));var path=require(_0x9c87('0x7'));var sox=require(_0x9c87('0x8'));var csv=require(_0x9c87('0x9'));var ejs=require(_0x9c87('0xa'));var fs=require('fs');var fs_extra=require(_0x9c87('0xb'));var _=require('lodash');var squel=require(_0x9c87('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c87('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9c87('0xe'));var Papa=require(_0x9c87('0xf'));var Redis=require(_0x9c87('0x10'));var authService=require(_0x9c87('0x11'));var qs=require(_0x9c87('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c87('0x13'));var logger=require('../../config/logger')(_0x9c87('0x14'));var utils=require(_0x9c87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9c87('0x16'));var db=require(_0x9c87('0x17'))['db'];config[_0x9c87('0x18')]=_[_0x9c87('0x19')](config[_0x9c87('0x18')],{'host':_0x9c87('0x1a'),'port':0x18eb});var socket=require(_0x9c87('0x1b'))(new Redis(config['redis']));require(_0x9c87('0x1c'))[_0x9c87('0x1d')](socket);function respondWithStatusCode(_0x1b1b4e,_0x472e9f){_0x472e9f=_0x472e9f||0xcc;return function(_0x2c928e){if(_0x2c928e){return _0x1b1b4e[_0x9c87('0x1e')](_0x472e9f);}return _0x1b1b4e[_0x9c87('0x1f')](_0x472e9f)[_0x9c87('0x20')]();};}function respondWithResult(_0x21d637,_0x1c7628){_0x1c7628=_0x1c7628||0xc8;return function(_0xa32f90){if(_0xa32f90){return _0x21d637['status'](_0x1c7628)[_0x9c87('0x21')](_0xa32f90);}};}function respondWithFilteredResult(_0x2dd586,_0x2507bb){return function(_0xeac869){if(_0xeac869){var _0x427240=typeof _0x2507bb[_0x9c87('0x22')]===_0x9c87('0x23')&&typeof _0x2507bb[_0x9c87('0x24')]===_0x9c87('0x23');var _0x322563=_0xeac869['count'];var _0x1a6a7f=_0x427240?0x0:_0x2507bb[_0x9c87('0x22')];var _0x226b5=_0x427240?_0xeac869[_0x9c87('0x25')]:_0x2507bb[_0x9c87('0x22')]+_0x2507bb[_0x9c87('0x24')];var _0x4016c8;if(_0x226b5>=_0x322563){_0x226b5=_0x322563;_0x4016c8=0xc8;}else{_0x4016c8=0xce;}_0x2dd586[_0x9c87('0x1f')](_0x4016c8);return _0x2dd586['set'](_0x9c87('0x26'),_0x1a6a7f+'-'+_0x226b5+'/'+_0x322563)[_0x9c87('0x21')](_0xeac869);}return null;};}function patchUpdates(_0x1bb5ee){return function(_0x506d84){try{jsonpatch[_0x9c87('0x27')](_0x506d84,_0x1bb5ee,!![]);}catch(_0x136ba1){return BPromise[_0x9c87('0x28')](_0x136ba1);}return _0x506d84[_0x9c87('0x29')]();};}function saveUpdates(_0x571065,_0x52e558){return function(_0x4d46a0){if(_0x4d46a0){return _0x4d46a0[_0x9c87('0x2a')](_0x571065)['then'](function(_0x33487f){return _0x33487f;});}return null;};}function removeEntity(_0x58a702,_0x40a06c){return function(_0x2b7ddf){if(_0x2b7ddf){return _0x2b7ddf[_0x9c87('0x2b')]()['then'](function(){_0x58a702['status'](0xcc)[_0x9c87('0x20')]();});}};}function handleEntityNotFound(_0x1e169b,_0x4633fb){return function(_0x1b94ec){if(!_0x1b94ec){_0x1e169b[_0x9c87('0x1e')](0x194);}return _0x1b94ec;};}function handleError(_0x396794,_0x5e2c6a){_0x5e2c6a=_0x5e2c6a||0x1f4;return function(_0x58029b){logger['error'](_0x58029b[_0x9c87('0x2c')]);if(_0x58029b[_0x9c87('0x2d')]){delete _0x58029b['name'];}_0x396794[_0x9c87('0x1f')](_0x5e2c6a)['send'](_0x58029b);};}exports[_0x9c87('0x2e')]=function(_0x4c2477,_0x12a939){var _0x2a6105={},_0xed8b2b={},_0x3a549d={'count':0x0,'rows':[]};var _0x4debec=_[_0x9c87('0x2f')](db['ChatInternalMessage']['rawAttributes'],function(_0x4f464a){return{'name':_0x4f464a[_0x9c87('0x30')],'type':_0x4f464a['type']['key']};});_0xed8b2b['model']=_['map'](_0x4debec,_0x9c87('0x2d'));_0xed8b2b[_0x9c87('0x31')]=_['keys'](_0x4c2477[_0x9c87('0x31')]);_0xed8b2b[_0x9c87('0x32')]=_[_0x9c87('0x33')](_0xed8b2b['model'],_0xed8b2b[_0x9c87('0x31')]);_0x2a6105[_0x9c87('0x34')]=_[_0x9c87('0x33')](_0xed8b2b[_0x9c87('0x35')],qs[_0x9c87('0x36')](_0x4c2477[_0x9c87('0x31')]['fields']));_0x2a6105[_0x9c87('0x34')]=_0x2a6105[_0x9c87('0x34')][_0x9c87('0x37')]?_0x2a6105['attributes']:_0xed8b2b[_0x9c87('0x35')];if(!_0x4c2477[_0x9c87('0x31')]['hasOwnProperty'](_0x9c87('0x38'))){_0x2a6105[_0x9c87('0x24')]=qs[_0x9c87('0x24')](_0x4c2477[_0x9c87('0x31')][_0x9c87('0x24')]);_0x2a6105[_0x9c87('0x22')]=qs[_0x9c87('0x22')](_0x4c2477[_0x9c87('0x31')][_0x9c87('0x22')]);}_0x2a6105[_0x9c87('0x39')]=qs['sort'](_0x4c2477[_0x9c87('0x31')]['sort']);_0x2a6105[_0x9c87('0x3a')]=qs[_0x9c87('0x32')](_[_0x9c87('0x3b')](_0x4c2477['query'],_0xed8b2b[_0x9c87('0x32')]),_0x4debec);if(_0x4c2477[_0x9c87('0x31')][_0x9c87('0x3c')]){_0x2a6105[_0x9c87('0x3a')]=_[_0x9c87('0x3d')](_0x2a6105[_0x9c87('0x3a')],{'$or':_['map'](_0x4debec,function(_0x324347){if(_0x324347[_0x9c87('0x3e')]!==_0x9c87('0x3f')){var _0x23dc90={};_0x23dc90[_0x324347['name']]={'$like':'%'+_0x4c2477[_0x9c87('0x31')][_0x9c87('0x3c')]+'%'};return _0x23dc90;}})});}_0x2a6105=_[_0x9c87('0x3d')]({},_0x2a6105,_0x4c2477['options']);var _0x4b5fd8={'where':_0x2a6105[_0x9c87('0x3a')]};return db[_0x9c87('0x40')]['count'](_0x4b5fd8)[_0x9c87('0x41')](function(_0x5cafce){_0x3a549d[_0x9c87('0x25')]=_0x5cafce;if(_0x4c2477['query']['includeAll']){_0x2a6105[_0x9c87('0x42')]=[{'all':!![]}];}return db[_0x9c87('0x40')][_0x9c87('0x43')](_0x2a6105);})[_0x9c87('0x41')](function(_0x6e8d3){_0x3a549d['rows']=_0x6e8d3;return _0x3a549d;})[_0x9c87('0x41')](respondWithFilteredResult(_0x12a939,_0x2a6105))[_0x9c87('0x44')](handleError(_0x12a939,null));};exports[_0x9c87('0x45')]=function(_0x1ad7b8,_0x27d1d5){var _0x54795a={'raw':!![],'where':{'id':_0x1ad7b8[_0x9c87('0x46')]['id']}},_0x3c25ad={};_0x3c25ad[_0x9c87('0x35')]=_[_0x9c87('0x47')](db['ChatInternalMessage']['rawAttributes']);_0x3c25ad[_0x9c87('0x31')]=_[_0x9c87('0x47')](_0x1ad7b8[_0x9c87('0x31')]);_0x3c25ad[_0x9c87('0x32')]=_[_0x9c87('0x33')](_0x3c25ad[_0x9c87('0x35')],_0x3c25ad['query']);_0x54795a[_0x9c87('0x34')]=_[_0x9c87('0x33')](_0x3c25ad[_0x9c87('0x35')],qs[_0x9c87('0x36')](_0x1ad7b8[_0x9c87('0x31')][_0x9c87('0x36')]));_0x54795a[_0x9c87('0x34')]=_0x54795a[_0x9c87('0x34')][_0x9c87('0x37')]?_0x54795a['attributes']:_0x3c25ad['model'];if(_0x1ad7b8[_0x9c87('0x31')][_0x9c87('0x48')]){_0x54795a[_0x9c87('0x42')]=[{'all':!![]}];}_0x54795a=_[_0x9c87('0x3d')]({},_0x54795a,_0x1ad7b8[_0x9c87('0x49')]);return db[_0x9c87('0x40')][_0x9c87('0x4a')](_0x54795a)['then'](handleEntityNotFound(_0x27d1d5,null))[_0x9c87('0x41')](respondWithResult(_0x27d1d5,null))['catch'](handleError(_0x27d1d5,null));};exports[_0x9c87('0x4b')]=function(_0x26a4db,_0x5a01d1){return db[_0x9c87('0x40')]['create'](_0x26a4db[_0x9c87('0x4c')],{})[_0x9c87('0x41')](respondWithResult(_0x5a01d1,0xc9))['catch'](handleError(_0x5a01d1,null));};exports[_0x9c87('0x2a')]=function(_0x3bb56e,_0x57cce2){if(_0x3bb56e[_0x9c87('0x4c')]['id']){delete _0x3bb56e[_0x9c87('0x4c')]['id'];}return db[_0x9c87('0x40')][_0x9c87('0x4a')]({'where':{'id':_0x3bb56e['params']['id']}})[_0x9c87('0x41')](handleEntityNotFound(_0x57cce2,null))['then'](saveUpdates(_0x3bb56e[_0x9c87('0x4c')],null))[_0x9c87('0x41')](respondWithResult(_0x57cce2,null))[_0x9c87('0x44')](handleError(_0x57cce2,null));};exports[_0x9c87('0x2b')]=function(_0x52e823,_0x1959bc){return db['ChatInternalMessage'][_0x9c87('0x4a')]({'where':{'id':_0x52e823[_0x9c87('0x46')]['id']}})[_0x9c87('0x41')](handleEntityNotFound(_0x1959bc,null))['then'](removeEntity(_0x1959bc,null))[_0x9c87('0x44')](handleError(_0x1959bc,null));};exports[_0x9c87('0x4d')]=function(_0x39cf27,_0x3da7a7){return db['ChatInternalMessage']['describe']()[_0x9c87('0x41')](respondWithResult(_0x3da7a7,null))[_0x9c87('0x44')](handleError(_0x3da7a7,null));};function wrapUser(_0x2beb00){return function(_0x8a948f){var _0x578c19=_0x2beb00[_0x9c87('0x4e')]({'plain':!![]});_0x578c19[_0x9c87('0x4f')]=[];if(_0x8a948f){_0x578c19[_0x9c87('0x50')]=_0x8a948f[_0x9c87('0x51')];_0x578c19[_0x9c87('0x52')]=_0x8a948f;}else{_0x578c19[_0x9c87('0x50')]=moment(0x0)[_0x9c87('0x53')](_0x9c87('0x54'));_0x578c19[_0x9c87('0x52')]={};}return _0x578c19;};}exports[_0x9c87('0x55')]=function(_0x39e627,_0x3e8d06,_0x15c080){var _0x878772=[];return db[_0x9c87('0x56')][_0x9c87('0x43')]({'where':{'role':['agent',_0x9c87('0x57'),'user']},'attributes':['id',_0x9c87('0x58'),_0x9c87('0x2d'),_0x9c87('0x59'),'userpic','internal',_0x9c87('0x5a'),_0x9c87('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0x9c87('0x5c')]('-online'),'include':[{'model':db[_0x9c87('0x5d')],'as':_0x9c87('0x5e'),'attributes':['id',_0x9c87('0x2d'),_0x9c87('0x3e')],'through':{'attributes':[]}}]})[_0x9c87('0x41')](function(_0x3d14b0){if(_0x3d14b0){var _0x86440d=_0x39e627[_0x9c87('0x5f')][_0x9c87('0x4e')]({'plain':!![]});if(!_0x86440d)throw new Error(_0x9c87('0x60'));if(_0x86440d[_0x9c87('0x59')]===_0x9c87('0x5f')){return db[_0x9c87('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x86440d[_0x9c87('0x62')]},'raw':!![]})['then'](function(_0x21adf8){if(_0x21adf8){if(_0x21adf8[_0x9c87('0x63')]===0x0){return db[_0x9c87('0x64')]['findAll']({'where':{'sectionId':_0x21adf8['id']},'raw':!![]})[_0x9c87('0x41')](function(_0xa5092f){var _0x292c5f=[];if(_[_0x9c87('0x65')](_0xa5092f)){_0x292c5f=_['filter'](_0x3d14b0,function(_0x1ec3a7){if(_0x1ec3a7[_0x9c87('0x59')]!==_0x9c87('0x66')){return _0x1ec3a7;}});return _0x292c5f;}else{for(var _0x3c06eb=0x0;_0x3c06eb<_0x3d14b0[_0x9c87('0x37')];_0x3c06eb++){var _0x1820b5=_0x3d14b0[_0x3c06eb];if(_0x1820b5[_0x9c87('0x59')]===_0x9c87('0x66')){var _0x6ef7ef=_[_0x9c87('0x4a')](_0xa5092f,function(_0x116e7e){return _0x116e7e[_0x9c87('0x67')]===_0x1820b5['id'];});if(_0x6ef7ef)_0x292c5f[_0x9c87('0x68')](_0x1820b5);}else{_0x292c5f[_0x9c87('0x68')](_0x1820b5);}}return _0x292c5f;}});}else{return _0x3d14b0;}}else{var _0xeea046=_[_0x9c87('0x3c')](_0x3d14b0,function(_0x15ff74){if(_0x15ff74[_0x9c87('0x59')]!==_0x9c87('0x66')){return _0x15ff74;}});return _0xeea046;}});}else{return _0x3d14b0;}}})['then'](function(_0x31cff4){var _0x3b297d=[];if(_0x31cff4){_0x878772=_0x31cff4;for(var _0x200a55=0x0;_0x200a55<_0x31cff4[_0x9c87('0x37')];_0x200a55+=0x1){_0x878772[_0x200a55][_0x9c87('0x4f')]=[];_0x3b297d[_0x9c87('0x68')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x39e627['user']['id'],_0x31cff4[_0x200a55]['id']],'ToId':[_0x39e627['user']['id'],_0x31cff4[_0x200a55]['id']],'ChatGroupId':null},'attributes':['id',_0x9c87('0x51'),_0x9c87('0x69'),'ToId',_0x9c87('0x6a'),_0x9c87('0x4c')],'order':qs['sort'](_0x9c87('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x31cff4[_0x200a55])));}return BPromise['all'](_0x3b297d);}return[];})['then'](function(_0x33e8a3){return{'rows':_0x33e8a3,'count':_0x33e8a3[_0x9c87('0x37')]};})['then'](respondWithResult(_0x3e8d06,null))[_0x9c87('0x44')](handleError(_0x3e8d06,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index fd99a13..6bf2050 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 _0xb7b9=['save','emit','hasOwnProperty','ChatInternalMessage'];(function(_0x22a633,_0x19707f){var _0x24e275=function(_0x5eb720){while(--_0x5eb720){_0x22a633['push'](_0x22a633['shift']());}};_0x24e275(++_0x19707f);}(_0xb7b9,0xcf));var _0x9b7b=function(_0x4cb660,_0x4c2f2c){_0x4cb660=_0x4cb660-0x0;var _0x476e24=_0xb7b9[_0x4cb660];return _0x476e24;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x9b7b('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b7b('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x32a53d){return function(_0x4815ad,_0x4ad0f4,_0x2e1e13){ChatInternalMessageEvents[_0x9b7b('0x2')](_0x32a53d+':'+_0x4815ad['id'],_0x4815ad);ChatInternalMessageEvents[_0x9b7b('0x2')](_0x32a53d,_0x4815ad);_0x2e1e13(null);};}for(var e in events){if(events[_0x9b7b('0x3')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x6df6=['hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x31d6c2,_0x422dcd){var _0x295dd0=function(_0x2b5dd1){while(--_0x2b5dd1){_0x31d6c2['push'](_0x31d6c2['shift']());}};_0x295dd0(++_0x422dcd);}(_0x6df6,0xb6));var _0x66df=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x6df6[_0x597484];return _0x218e64;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x66df('0x0'))['db'][_0x66df('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x66df('0x2')](0x0);var events={'afterCreate':_0x66df('0x3'),'afterUpdate':'update','afterDestroy':_0x66df('0x4')};function emitEvent(_0x228964){return function(_0x1d6492,_0x465d71,_0x3cd814){ChatInternalMessageEvents['emit'](_0x228964+':'+_0x1d6492['id'],_0x1d6492);ChatInternalMessageEvents[_0x66df('0x5')](_0x228964,_0x1d6492);_0x3cd814(null);};}for(var e in events){if(events[_0x66df('0x6')](e)){var event=events[e];ChatInternalMessage[_0x66df('0x7')](e,emitEvent(event));}}module[_0x66df('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 89819ea..aa18201 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 _0xf048=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5d5024,_0x4b13ca){var _0x26618e=function(_0x5a4ceb){while(--_0x5a4ceb){_0x5d5024['push'](_0x5d5024['shift']());}};_0x26618e(++_0x4b13ca);}(_0xf048,0x1a1));var _0x8f04=function(_0x5b7ba9,_0x4d437d){_0x5b7ba9=_0x5b7ba9-0x0;var _0xd17602=_0xf048[_0x5b7ba9];return _0xd17602;};'use strict';var _=require(_0x8f04('0x0'));var util=require('util');var logger=require(_0x8f04('0x1'))(_0x8f04('0x2'));var moment=require(_0x8f04('0x3'));var BPromise=require(_0x8f04('0x4'));var rp=require(_0x8f04('0x5'));var fs=require('fs');var path=require(_0x8f04('0x6'));var rimraf=require(_0x8f04('0x7'));var config=require(_0x8f04('0x8'));var attributes=require(_0x8f04('0x9'));module[_0x8f04('0xa')]=function(_0x54dac2,_0x5310aa){return _0x54dac2['define'](_0x8f04('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8f04('0xc'),'collate':_0x8f04('0xd')});};
\ No newline at end of file
+var _0xe77d=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x3312a3,_0x3f9cdb){var _0x262560=function(_0x51880a){while(--_0x51880a){_0x3312a3['push'](_0x3312a3['shift']());}};_0x262560(++_0x3f9cdb);}(_0xe77d,0x163));var _0xde77=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xe77d[_0x581249];return _0x284bae;};'use strict';var _=require(_0xde77('0x0'));var util=require(_0xde77('0x1'));var logger=require(_0xde77('0x2'))(_0xde77('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde77('0x4'));var fs=require('fs');var path=require(_0xde77('0x5'));var rimraf=require(_0xde77('0x6'));var config=require(_0xde77('0x7'));var attributes=require(_0xde77('0x8'));module['exports']=function(_0x41c6c2,_0x44d28a){return _0x41c6c2[_0xde77('0x9')](_0xde77('0xa'),attributes,{'tableName':_0xde77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde77('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index ddfb7b9..10f081c 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 _0x899a=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x573e59,_0x38748d){var _0x40ae80=function(_0x4c3616){while(--_0x4c3616){_0x573e59['push'](_0x573e59['shift']());}};_0x40ae80(++_0x38748d);}(_0x899a,0x1b6));var _0xa899=function(_0x174531,_0x14049a){_0x174531=_0x174531-0x0;var _0x41b887=_0x899a[_0x174531];return _0x41b887;};'use strict';var _=require(_0xa899('0x0'));var util=require(_0xa899('0x1'));var moment=require('moment');var BPromise=require(_0xa899('0x2'));var rs=require(_0xa899('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa899('0x4'))['db'];var utils=require(_0xa899('0x5'));var logger=require(_0xa899('0x6'))(_0xa899('0x7'));var config=require('../../config/environment');var jayson=require(_0xa899('0x8'));var client=jayson[_0xa899('0x9')][_0xa899('0xa')]({'port':0x232a});config[_0xa899('0xb')]=_['defaults'](config[_0xa899('0xb')],{'host':_0xa899('0xc'),'port':0x18eb});var socket=require(_0xa899('0xd'))(new Redis(config[_0xa899('0xb')]));require(_0xa899('0xe'))[_0xa899('0xf')](socket);function respondWithRpcPromise(_0x30954d,_0x184920,_0x1fbfa6){return new BPromise(function(_0x34282a,_0x5a6582){return client[_0xa899('0x10')](_0x30954d,_0x1fbfa6)['then'](function(_0x4eb704){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x184920,_0xa899('0x11'));logger[_0xa899('0x12')](_0xa899('0x13'),_0x184920,'request\x20sent',JSON[_0xa899('0x14')](_0x4eb704));if(_0x4eb704[_0xa899('0x15')]){if(_0x4eb704['error'][_0xa899('0x16')]===0x1f4){logger[_0xa899('0x15')](_0xa899('0x17'),_0x184920,_0x4eb704[_0xa899('0x15')]['message']);return _0x5a6582(_0x4eb704[_0xa899('0x15')][_0xa899('0x18')]);}logger['error'](_0xa899('0x17'),_0x184920,_0x4eb704[_0xa899('0x15')][_0xa899('0x18')]);return _0x34282a(_0x4eb704['error']['message']);}else{logger[_0xa899('0x19')](_0xa899('0x17'),_0x184920,_0xa899('0x11'));_0x34282a(_0x4eb704[_0xa899('0x1a')][_0xa899('0x18')]);}})['catch'](function(_0x332ced){logger['error'](_0xa899('0x17'),_0x184920,_0x332ced);_0x5a6582(_0x332ced);});});}
\ No newline at end of file
+var _0xaf73=['../../config/utils','../../config/environment','jayson/promise','client','http','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','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2d8040,_0x3b44b1){var _0x2dfc90=function(_0xad65ee){while(--_0xad65ee){_0x2d8040['push'](_0x2d8040['shift']());}};_0x2dfc90(++_0x3b44b1);}(_0xaf73,0x19d));var _0x3af7=function(_0x3e2081,_0x55efd1){_0x3e2081=_0x3e2081-0x0;var _0x2897b0=_0xaf73[_0x3e2081];return _0x2897b0;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var moment=require(_0x3af7('0x2'));var BPromise=require(_0x3af7('0x3'));var rs=require(_0x3af7('0x4'));var fs=require('fs');var Redis=require(_0x3af7('0x5'));var db=require(_0x3af7('0x6'))['db'];var utils=require(_0x3af7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3af7('0x8'));var jayson=require(_0x3af7('0x9'));var client=jayson[_0x3af7('0xa')][_0x3af7('0xb')]({'port':0x232a});config[_0x3af7('0xc')]=_[_0x3af7('0xd')](config[_0x3af7('0xc')],{'host':_0x3af7('0xe'),'port':0x18eb});var socket=require(_0x3af7('0xf'))(new Redis(config[_0x3af7('0xc')]));require(_0x3af7('0x10'))[_0x3af7('0x11')](socket);function respondWithRpcPromise(_0xc028c3,_0x53840e,_0x2506dd){return new BPromise(function(_0x2f3265,_0x421c26){return client[_0x3af7('0x12')](_0xc028c3,_0x2506dd)[_0x3af7('0x13')](function(_0x17705b){logger[_0x3af7('0x14')](_0x3af7('0x15'),_0x53840e,_0x3af7('0x16'));logger[_0x3af7('0x17')](_0x3af7('0x18'),_0x53840e,'request\x20sent',JSON[_0x3af7('0x19')](_0x17705b));if(_0x17705b[_0x3af7('0x1a')]){if(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1b')]===0x1f4){logger['error'](_0x3af7('0x15'),_0x53840e,_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);return _0x421c26(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);}logger[_0x3af7('0x1a')](_0x3af7('0x15'),_0x53840e,_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);return _0x2f3265(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);}else{logger[_0x3af7('0x14')](_0x3af7('0x15'),_0x53840e,'request\x20sent');_0x2f3265(_0x17705b[_0x3af7('0x1d')][_0x3af7('0x1c')]);}})['catch'](function(_0x4d8dfd){logger['error'](_0x3af7('0x15'),_0x53840e,_0x4d8dfd);_0x421c26(_0x4d8dfd);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index edc8a61..a4e77ed 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 _0x2d2c=['./chatInternalMessage.events','save','remove','update','removeListener','length','chatInternalMessage:'];(function(_0x53afd7,_0x926178){var _0x32ff71=function(_0x124bb5){while(--_0x124bb5){_0x53afd7['push'](_0x53afd7['shift']());}};_0x32ff71(++_0x926178);}(_0x2d2c,0xfc));var _0xc2d2=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0x2d2c[_0x397f37];return _0x31cae6;};'use strict';var ChatInternalMessageEvents=require(_0xc2d2('0x0'));var events=[_0xc2d2('0x1'),_0xc2d2('0x2'),_0xc2d2('0x3')];function createListener(_0x33e548,_0x5293e2){return function(_0x52cb1e){_0x5293e2['emit'](_0x33e548,_0x52cb1e);};}function removeListener(_0x135cbb,_0x5ddc51){return function(){ChatInternalMessageEvents[_0xc2d2('0x4')](_0x135cbb,_0x5ddc51);};}exports['register']=function(_0x42fc19){for(var _0x1e8723=0x0,_0x29bb95=events[_0xc2d2('0x5')];_0x1e8723<_0x29bb95;_0x1e8723++){var _0x578d52=events[_0x1e8723];var _0x286152=createListener(_0xc2d2('0x6')+_0x578d52,_0x42fc19);ChatInternalMessageEvents['on'](_0x578d52,_0x286152);}};
\ No newline at end of file
+var _0x13ae=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x13ae,0x8b));var _0xe13a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x13ae[_0x2be8c2];return _0x97f531;};'use strict';var ChatInternalMessageEvents=require(_0xe13a('0x0'));var events=[_0xe13a('0x1'),_0xe13a('0x2'),_0xe13a('0x3')];function createListener(_0x5564db,_0x30c11b){return function(_0x241bca){_0x30c11b[_0xe13a('0x4')](_0x5564db,_0x241bca);};}function removeListener(_0x501902,_0x1fd819){return function(){ChatInternalMessageEvents[_0xe13a('0x5')](_0x501902,_0x1fd819);};}exports[_0xe13a('0x6')]=function(_0x4f4051){for(var _0x3359d1=0x0,_0x82892a=events[_0xe13a('0x7')];_0x3359d1<_0x82892a;_0x3359d1++){var _0x505f4f=events[_0x3359d1];var _0x5b098d=createListener(_0xe13a('0x8')+_0x505f4f,_0x4f4051);ChatInternalMessageEvents['on'](_0x505f4f,_0x5b098d);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 238ba76..0b271c2 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 _0x88d5=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy'];(function(_0x23a796,_0x48fb50){var _0xa62cb4=function(_0x5dbe47){while(--_0x5dbe47){_0x23a796['push'](_0x23a796['shift']());}};_0xa62cb4(++_0x48fb50);}(_0x88d5,0x83));var _0x588d=function(_0x3ec023,_0xc91590){_0x3ec023=_0x3ec023-0x0;var _0x38db02=_0x88d5[_0x3ec023];return _0x38db02;};'use strict';var multer=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var path=require(_0x588d('0x2'));var timeout=require(_0x588d('0x3'));var express=require(_0x588d('0x4'));var router=express[_0x588d('0x5')]();var fs_extra=require(_0x588d('0x6'));var auth=require(_0x588d('0x7'));var interaction=require(_0x588d('0x8'));var config=require(_0x588d('0x9'));var controller=require(_0x588d('0xa'));router[_0x588d('0xb')]('/',auth['isAuthenticated'](),controller[_0x588d('0xc')]);router[_0x588d('0xb')]('/describe',auth[_0x588d('0xd')](),controller[_0x588d('0xe')]);router[_0x588d('0xb')](_0x588d('0xf'),auth[_0x588d('0xd')](),controller[_0x588d('0x10')]);router[_0x588d('0xb')](_0x588d('0x11'),auth[_0x588d('0xd')](),controller[_0x588d('0x12')]);router[_0x588d('0x13')]('/',auth[_0x588d('0xd')](),controller[_0x588d('0x14')]);router[_0x588d('0x15')]('/:id',controller[_0x588d('0x16')]);router[_0x588d('0x17')](_0x588d('0x11'),auth['isAuthenticated'](),controller[_0x588d('0x18')]);module[_0x588d('0x19')]=router;
\ No newline at end of file
+var _0xaf12=['show','post','create','update','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','/describe','describe','/users','isAuthenticated','getUsers','/:id'];(function(_0xbcc312,_0x26429c){var _0x1edbb5=function(_0x17bb24){while(--_0x17bb24){_0xbcc312['push'](_0xbcc312['shift']());}};_0x1edbb5(++_0x26429c);}(_0xaf12,0x1cd));var _0x2af1=function(_0x3001e6,_0xec7ba1){_0x3001e6=_0x3001e6-0x0;var _0x578018=_0xaf12[_0x3001e6];return _0x578018;};'use strict';var multer=require(_0x2af1('0x0'));var util=require(_0x2af1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2af1('0x2'));var router=express['Router']();var fs_extra=require(_0x2af1('0x3'));var auth=require(_0x2af1('0x4'));var interaction=require(_0x2af1('0x5'));var config=require('../../config/environment');var controller=require(_0x2af1('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2af1('0x7')](_0x2af1('0x8'),auth['isAuthenticated'](),controller[_0x2af1('0x9')]);router[_0x2af1('0x7')](_0x2af1('0xa'),auth[_0x2af1('0xb')](),controller[_0x2af1('0xc')]);router[_0x2af1('0x7')](_0x2af1('0xd'),auth[_0x2af1('0xb')](),controller[_0x2af1('0xe')]);router[_0x2af1('0xf')]('/',auth[_0x2af1('0xb')](),controller[_0x2af1('0x10')]);router['put']('/:id',controller[_0x2af1('0x11')]);router['delete'](_0x2af1('0xd'),auth[_0x2af1('0xb')](),controller['destroy']);module[_0x2af1('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 1ec30e9..9c34573 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 _0xfd7b=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x37a846,_0x1beab2){var _0x4cd7e2=function(_0x1b6c65){while(--_0x1b6c65){_0x37a846['push'](_0x37a846['shift']());}};_0x4cd7e2(++_0x1beab2);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xfd7b[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xbfd7('0x0'));module[_0xbfd7('0x1')]={'body':{'type':Sequelize[_0xbfd7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbfd7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbfd7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbfd7('0x4')]('in','out'),'defaultValue':_0xbfd7('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbfd7('0x6')]},'providerName':{'type':Sequelize[_0xbfd7('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x33bca9,_0x25672f){var _0x3190f0=function(_0x1cd6db){while(--_0x1cd6db){_0x33bca9['push'](_0x33bca9['shift']());}};_0x3190f0(++_0x25672f);}(_0x39c4,0x174));var _0x439c=function(_0xa233b,_0x234c9d){_0xa233b=_0xa233b-0x0;var _0x2471d7=_0x39c4[_0xa233b];return _0x2471d7;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x439c('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x439c('0x3')]},'providerName':{'type':Sequelize[_0x439c('0x4')]},'providerResponse':{'type':Sequelize[_0x439c('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 7243863..d4eaf6e 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 _0x83f0=['SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','fullname','email','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','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','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save','update','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','filter','options','include','findAll','rows','show','params','keys','length','includeAll','create','body','find','describe','accept','chat','read','readAt','format','UserId','agent','get','ChatInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','interface'];(function(_0x2701fd,_0x506374){var _0x2a9cff=function(_0x4aaec1){while(--_0x4aaec1){_0x2701fd['push'](_0x2701fd['shift']());}};_0x2a9cff(++_0x506374);}(_0x83f0,0x99));var _0x083f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x83f0[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x083f('0x0'));var rimraf=require(_0x083f('0x1'));var zipdir=require(_0x083f('0x2'));var jsonpatch=require(_0x083f('0x3'));var rp=require(_0x083f('0x4'));var moment=require('moment');var BPromise=require(_0x083f('0x5'));var Mustache=require(_0x083f('0x6'));var util=require('util');var path=require(_0x083f('0x7'));var sox=require(_0x083f('0x8'));var csv=require(_0x083f('0x9'));var ejs=require(_0x083f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x083f('0xb'));var squel=require(_0x083f('0xc'));var crypto=require(_0x083f('0xd'));var jsforce=require(_0x083f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x083f('0xf'));var Papa=require(_0x083f('0x10'));var Redis=require(_0x083f('0x11'));var authService=require(_0x083f('0x12'));var qs=require(_0x083f('0x13'));var as=require(_0x083f('0x14'));var hardwareService=require(_0x083f('0x15'));var logger=require(_0x083f('0x16'))(_0x083f('0x17'));var utils=require(_0x083f('0x18'));var config=require(_0x083f('0x19'));var licenseUtil=require(_0x083f('0x1a'));var db=require(_0x083f('0x1b'))['db'];config['redis']=_['defaults'](config[_0x083f('0x1c')],{'host':_0x083f('0x1d'),'port':0x18eb});var socket=require(_0x083f('0x1e'))(new Redis(config[_0x083f('0x1c')]));require(_0x083f('0x1f'))[_0x083f('0x20')](socket);var jayson=require(_0x083f('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x083f('0x22')][_0x083f('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x5375e4,_0xde980a,_0x5d757a,_0x56118d){return new BPromise(function(_0x3371f0,_0xc47aef){var _0x4b597e=_0x56118d||client;return _0x4b597e[_0x083f('0x24')](_0x5375e4,_0x5d757a)[_0x083f('0x25')](function(_0x1816dc){logger['info'](_0x083f('0x26'),_0xde980a,_0x083f('0x27'));logger[_0x083f('0x28')](_0x083f('0x29'),_0xde980a,_0x083f('0x27'),JSON[_0x083f('0x2a')](_0x1816dc));if(_0x1816dc[_0x083f('0x2b')]){if(_0x1816dc[_0x083f('0x2b')][_0x083f('0x2c')]===0x1f4){logger[_0x083f('0x2b')](_0x083f('0x26'),_0xde980a,_0x1816dc['error'][_0x083f('0x2d')]);return _0xc47aef(_0x1816dc[_0x083f('0x2b')][_0x083f('0x2d')]);}logger[_0x083f('0x2b')](_0x083f('0x26'),_0xde980a,_0x1816dc['error'][_0x083f('0x2d')]);return _0x3371f0(_0x1816dc[_0x083f('0x2b')][_0x083f('0x2d')]);}else{logger[_0x083f('0x2e')]('ChatMessage,\x20%s,\x20%s',_0xde980a,_0x083f('0x27'));_0x3371f0(_0x1816dc[_0x083f('0x2f')][_0x083f('0x2d')]);}})[_0x083f('0x30')](function(_0x4812f0){logger[_0x083f('0x2b')]('ChatMessage,\x20%s,\x20%s',_0xde980a,_0x4812f0);_0xc47aef(_0x4812f0);});});}function respondWithStatusCode(_0x11f6d3,_0xa2bfe0){_0xa2bfe0=_0xa2bfe0||0xcc;return function(_0x379247){if(_0x379247){return _0x11f6d3[_0x083f('0x31')](_0xa2bfe0);}return _0x11f6d3['status'](_0xa2bfe0)[_0x083f('0x32')]();};}function respondWithResult(_0x5bddb6,_0x3973ad){_0x3973ad=_0x3973ad||0xc8;return function(_0x5475c5){if(_0x5475c5){return _0x5bddb6[_0x083f('0x33')](_0x3973ad)[_0x083f('0x34')](_0x5475c5);}};}function respondWithFilteredResult(_0x200886,_0x172f1d){return function(_0x4a93c7){if(_0x4a93c7){var _0x19409b=typeof _0x172f1d[_0x083f('0x35')]===_0x083f('0x36')&&typeof _0x172f1d['limit']===_0x083f('0x36');var _0x162bb4=_0x4a93c7['count'];var _0x319954=_0x19409b?0x0:_0x172f1d[_0x083f('0x35')];var _0x355eb4=_0x19409b?_0x4a93c7[_0x083f('0x37')]:_0x172f1d[_0x083f('0x35')]+_0x172f1d[_0x083f('0x38')];var _0x4a4535;if(_0x355eb4>=_0x162bb4){_0x355eb4=_0x162bb4;_0x4a4535=0xc8;}else{_0x4a4535=0xce;}_0x200886['status'](_0x4a4535);return _0x200886['set']('Content-Range',_0x319954+'-'+_0x355eb4+'/'+_0x162bb4)[_0x083f('0x34')](_0x4a93c7);}return null;};}function patchUpdates(_0x1472b2){return function(_0x1f2c9f){try{jsonpatch[_0x083f('0x39')](_0x1f2c9f,_0x1472b2,!![]);}catch(_0x4dfc3c){return BPromise[_0x083f('0x3a')](_0x4dfc3c);}return _0x1f2c9f[_0x083f('0x3b')]();};}function saveUpdates(_0x1e0902,_0x4af0f8){return function(_0x142854){if(_0x142854){return _0x142854[_0x083f('0x3c')](_0x1e0902)[_0x083f('0x25')](function(_0x228408){return _0x228408;});}return null;};}function removeEntity(_0x2dcf45,_0x59634b){return function(_0x1f5c92){if(_0x1f5c92){return _0x1f5c92[_0x083f('0x3d')]()[_0x083f('0x25')](function(){_0x2dcf45[_0x083f('0x33')](0xcc)[_0x083f('0x32')]();});}};}function handleEntityNotFound(_0x52cf65,_0x9820a3){return function(_0x27ef51){if(!_0x27ef51){_0x52cf65[_0x083f('0x31')](0x194);}return _0x27ef51;};}function handleError(_0xf2a10f,_0x4a79b6){_0x4a79b6=_0x4a79b6||0x1f4;return function(_0x2a1bde){logger['error'](_0x2a1bde[_0x083f('0x3e')]);if(_0x2a1bde[_0x083f('0x3f')]){delete _0x2a1bde[_0x083f('0x3f')];}_0xf2a10f['status'](_0x4a79b6)[_0x083f('0x40')](_0x2a1bde);};}exports['index']=function(_0x22e2c3,_0x117db5){var _0x199595={},_0x7e1941={},_0x46a6d3={'count':0x0,'rows':[]};var _0x265790=_[_0x083f('0x41')](db[_0x083f('0x42')][_0x083f('0x43')],function(_0x5cf33e){return{'name':_0x5cf33e[_0x083f('0x44')],'type':_0x5cf33e['type'][_0x083f('0x45')]};});_0x7e1941[_0x083f('0x46')]=_[_0x083f('0x41')](_0x265790,_0x083f('0x3f'));_0x7e1941['query']=_['keys'](_0x22e2c3['query']);_0x7e1941['filters']=_[_0x083f('0x47')](_0x7e1941[_0x083f('0x46')],_0x7e1941[_0x083f('0x48')]);_0x199595[_0x083f('0x49')]=_[_0x083f('0x47')](_0x7e1941[_0x083f('0x46')],qs['fields'](_0x22e2c3[_0x083f('0x48')][_0x083f('0x4a')]));_0x199595[_0x083f('0x49')]=_0x199595['attributes']['length']?_0x199595['attributes']:_0x7e1941['model'];if(!_0x22e2c3[_0x083f('0x48')][_0x083f('0x4b')](_0x083f('0x4c'))){_0x199595[_0x083f('0x38')]=qs[_0x083f('0x38')](_0x22e2c3['query'][_0x083f('0x38')]);_0x199595['offset']=qs[_0x083f('0x35')](_0x22e2c3[_0x083f('0x48')][_0x083f('0x35')]);}_0x199595[_0x083f('0x4d')]=qs[_0x083f('0x4e')](_0x22e2c3['query'][_0x083f('0x4e')]);_0x199595['where']=qs[_0x083f('0x4f')](_[_0x083f('0x50')](_0x22e2c3[_0x083f('0x48')],_0x7e1941['filters']),_0x265790);if(_0x22e2c3['query']['filter']){_0x199595[_0x083f('0x51')]=_[_0x083f('0x52')](_0x199595[_0x083f('0x51')],{'$or':_[_0x083f('0x41')](_0x265790,function(_0x585b8b){if(_0x585b8b['type']!=='VIRTUAL'){var _0x4d9079={};_0x4d9079[_0x585b8b[_0x083f('0x3f')]]={'$like':'%'+_0x22e2c3[_0x083f('0x48')][_0x083f('0x53')]+'%'};return _0x4d9079;}})});}_0x199595=_['merge']({},_0x199595,_0x22e2c3[_0x083f('0x54')]);var _0x3bf87d={'where':_0x199595[_0x083f('0x51')]};return db[_0x083f('0x42')][_0x083f('0x37')](_0x3bf87d)[_0x083f('0x25')](function(_0x48c268){_0x46a6d3[_0x083f('0x37')]=_0x48c268;if(_0x22e2c3['query']['includeAll']){_0x199595[_0x083f('0x55')]=[{'all':!![]}];}return db[_0x083f('0x42')][_0x083f('0x56')](_0x199595);})[_0x083f('0x25')](function(_0x17fbe3){_0x46a6d3[_0x083f('0x57')]=_0x17fbe3;return _0x46a6d3;})['then'](respondWithFilteredResult(_0x117db5,_0x199595))[_0x083f('0x30')](handleError(_0x117db5,null));};exports[_0x083f('0x58')]=function(_0x7a6b1e,_0x22730e){var _0x569304={'raw':!![],'where':{'id':_0x7a6b1e[_0x083f('0x59')]['id']}},_0x3ecd11={};_0x3ecd11[_0x083f('0x46')]=_[_0x083f('0x5a')](db[_0x083f('0x42')][_0x083f('0x43')]);_0x3ecd11[_0x083f('0x48')]=_[_0x083f('0x5a')](_0x7a6b1e['query']);_0x3ecd11[_0x083f('0x4f')]=_[_0x083f('0x47')](_0x3ecd11['model'],_0x3ecd11['query']);_0x569304['attributes']=_[_0x083f('0x47')](_0x3ecd11[_0x083f('0x46')],qs[_0x083f('0x4a')](_0x7a6b1e['query'][_0x083f('0x4a')]));_0x569304[_0x083f('0x49')]=_0x569304[_0x083f('0x49')][_0x083f('0x5b')]?_0x569304[_0x083f('0x49')]:_0x3ecd11[_0x083f('0x46')];if(_0x7a6b1e['query'][_0x083f('0x5c')]){_0x569304[_0x083f('0x55')]=[{'all':!![]}];}_0x569304=_['merge']({},_0x569304,_0x7a6b1e['options']);return db[_0x083f('0x42')]['find'](_0x569304)['then'](handleEntityNotFound(_0x22730e,null))['then'](respondWithResult(_0x22730e,null))['catch'](handleError(_0x22730e,null));};exports[_0x083f('0x5d')]=function(_0x33ffbd,_0xf9663c){return db[_0x083f('0x42')][_0x083f('0x5d')](_0x33ffbd['body'],{})[_0x083f('0x25')](respondWithResult(_0xf9663c,0xc9))[_0x083f('0x30')](handleError(_0xf9663c,null));};exports[_0x083f('0x3c')]=function(_0xeccc51,_0x583c33){if(_0xeccc51[_0x083f('0x5e')]['id']){delete _0xeccc51['body']['id'];}return db[_0x083f('0x42')][_0x083f('0x5f')]({'where':{'id':_0xeccc51[_0x083f('0x59')]['id']}})['then'](handleEntityNotFound(_0x583c33,null))[_0x083f('0x25')](saveUpdates(_0xeccc51[_0x083f('0x5e')],null))[_0x083f('0x25')](respondWithResult(_0x583c33,null))[_0x083f('0x30')](handleError(_0x583c33,null));};exports[_0x083f('0x3d')]=function(_0x53e06c,_0x3fa58b){return db['ChatMessage'][_0x083f('0x5f')]({'where':{'id':_0x53e06c['params']['id']}})[_0x083f('0x25')](handleEntityNotFound(_0x3fa58b,null))[_0x083f('0x25')](removeEntity(_0x3fa58b,null))[_0x083f('0x30')](handleError(_0x3fa58b,null));};exports[_0x083f('0x60')]=function(_0x954329,_0x5e34ed){return db[_0x083f('0x42')]['describe']()[_0x083f('0x25')](respondWithResult(_0x5e34ed,null))[_0x083f('0x30')](handleError(_0x5e34ed,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x083f('0x61')]=function(_0x2a4693,_0xf88a59,_0x33b7a1){var _0x567519={'agent':{},'channel':_0x083f('0x62')};if(_0x2a4693[_0x083f('0x5e')]['id']){delete _0x2a4693[_0x083f('0x5e')]['id'];}_0x2a4693['body'][_0x083f('0x63')]=!![];_0x2a4693['body'][_0x083f('0x64')]=moment()[_0x083f('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a4693[_0x083f('0x5e')][_0x083f('0x66')]=_0x2a4693['body'][_0x083f('0x66')]||_0x2a4693['user']['id'];_0x567519[_0x083f('0x67')]['id']=_0x2a4693['body']['UserId'];return db[_0x083f('0x42')]['find']({'where':{'id':_0x2a4693[_0x083f('0x59')]['id'],'UserId':null}})[_0x083f('0x25')](handleEntityNotFound(_0xf88a59,null))[_0x083f('0x25')](saveUpdates(_0x2a4693['body'],null))[_0x083f('0x25')](function(_0x24f5d7){if(_0x24f5d7){_0x567519[_0x083f('0x2d')]=_0x24f5d7[_0x083f('0x68')]({'plain':!![]});return db[_0x083f('0x69')][_0x083f('0x5f')]({'where':{'id':_0x24f5d7['ChatInteractionId']}});}return null;})[_0x083f('0x25')](handleEntityNotFound(_0xf88a59,null))[_0x083f('0x25')](function(_0x129fd3){if(_0x129fd3){return _0x129fd3['update']({'UserId':_0x2a4693['body'][_0x083f('0x66')],'read1stAt':_[_0x083f('0x6a')](_0x129fd3['read1stAt'])?moment()[_0x083f('0x65')](_0x083f('0x6b')):undefined});}return null;})['then'](function(_0x515fbc){if(_0x515fbc){_0x567519[_0x083f('0x6c')]=_0x515fbc[_0x083f('0x68')]({'plain':!![]});interaction_log['info'](_0x083f('0x6d'),_0x2a4693[_0x083f('0x6e')]['id'],_0x2a4693['user'][_0x083f('0x3f')],_0x2a4693[_0x083f('0x6e')][_0x083f('0x6f')],_0x567519[_0x083f('0x6c')]['id'],_0x2a4693[_0x083f('0x5e')]?JSON[_0x083f('0x2a')](_0x2a4693[_0x083f('0x5e')]):_0x083f('0x70'));return respondWithRpcPromise(_0x083f('0x71'),_0x083f('0x72'),_0x567519);}return null;})[_0x083f('0x25')](function(_0xaf30ad){var _0x14e8f8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xaf30ad[_0x083f('0x2d')]['ContactId'];return db[_0x083f('0x73')]['query'](_0x14e8f8,{'type':db[_0x083f('0x74')][_0x083f('0x75')][_0x083f('0x76')],'raw':!![]})[_0x083f('0x25')](function(_0x978091){return _0x978091;});})[_0x083f('0x25')](function(_0x337c8a){if(_0x337c8a){_0x567519['message'][_0x083f('0x77')]=_0x337c8a[0x0];if(!_0x2a4693[_0x083f('0x5e')][_0x083f('0x66')])return;return db[_0x083f('0x78')][_0x083f('0x5f')]({'where':{'id':_0x2a4693[_0x083f('0x5e')][_0x083f('0x66')],'role':_0x083f('0x67')},'attributes':['id',_0x083f('0x3f'),'fullname','email',_0x083f('0x79')],'raw':!![]});}return null;})[_0x083f('0x25')](function(_0xe33f8c){if(!_0xe33f8c)return null;_0x567519[_0x083f('0x2d')][_0x083f('0x67')]=_0xe33f8c;return _0x567519;})[_0x083f('0x25')](function(_0x38534f){if(_0x38534f){if(_0x2a4693[_0x083f('0x5e')]['manual']){_0x567519['message'][_0x083f('0x7a')]=util['format'](_0x083f('0x7b'),_0x2a4693[_0x083f('0x6e')][_0x083f('0x3f')]);_0x567519[_0x083f('0x2d')][_0x083f('0x7c')]=_0x567519[_0x083f('0x7c')];_0x567519[_0x083f('0x2d')][_0x083f('0x7d')]=_0x567519[_0x083f('0x7c')];_0x567519[_0x083f('0x2d')][_0x083f('0x7e')]=_0x083f('0x61');return respondWithRpcPromise(_0x083f('0x7f'),'EventManager',{'event':_0x083f('0x80'),'message':_['merge'](_0x567519[_0x083f('0x2d')],JSON[_0x083f('0x81')](_0x567519['interaction'][_0x083f('0x82')]))},client9002)['then'](function(){return _0x567519;});}return _0x567519;}return null;})[_0x083f('0x25')](respondWithResult(_0xf88a59,null))[_0x083f('0x30')](handleError(_0xf88a59,null));};var interaction_log=require(_0x083f('0x16'))('chat-interactions');exports[_0x083f('0x3a')]=function(_0x4c8957,_0x32725e,_0x22a6ad){var _0xffb386={'agent':{},'channel':_0x083f('0x62')};if(_0x4c8957['body']['id']){delete _0x4c8957[_0x083f('0x5e')]['id'];}_0x4c8957['body'][_0x083f('0x66')]=_0x4c8957['body'][_0x083f('0x66')]||_0x4c8957['user']['id'];_0xffb386['agent']['id']=_0x4c8957[_0x083f('0x5e')][_0x083f('0x66')];return db[_0x083f('0x42')][_0x083f('0x5f')]({'where':{'id':_0x4c8957[_0x083f('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32725e,null))[_0x083f('0x25')](function(_0x33aabe){if(_0x33aabe){_0xffb386[_0x083f('0x2d')]=_0x33aabe[_0x083f('0x68')]({'plain':!![]});return db[_0x083f('0x69')][_0x083f('0x5f')]({'where':{'id':_0x33aabe[_0x083f('0x83')]}});}return null;})['then'](handleEntityNotFound(_0x32725e,null))[_0x083f('0x25')](function(_0x580499){if(_0x580499){_0xffb386[_0x083f('0x6c')]=_0x580499[_0x083f('0x68')]({'plain':!![]});interaction_log[_0x083f('0x2e')](_0x083f('0x84'),_0x4c8957[_0x083f('0x6e')]['id'],_0x4c8957[_0x083f('0x6e')][_0x083f('0x3f')],_0x4c8957['user'][_0x083f('0x6f')],_0xffb386[_0x083f('0x6c')]['id'],_0x4c8957['body']?JSON[_0x083f('0x2a')](_0x4c8957[_0x083f('0x5e')]):_0x083f('0x70'));return respondWithRpcPromise(_0x083f('0x85'),'rejectMessage',_0xffb386);}return null;})[_0x083f('0x25')](function(_0x406646){var _0x5ae848='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x406646[_0x083f('0x2d')][_0x083f('0x86')];return db[_0x083f('0x73')][_0x083f('0x48')](_0x5ae848,{'type':db[_0x083f('0x74')][_0x083f('0x75')][_0x083f('0x76')],'raw':!![]})[_0x083f('0x25')](function(_0x621d21){return _0x621d21;});})[_0x083f('0x25')](function(_0x1fc3c8){if(_0x1fc3c8){_0xffb386[_0x083f('0x2d')][_0x083f('0x77')]=_0x1fc3c8[0x0];if(!_0x4c8957[_0x083f('0x5e')][_0x083f('0x66')])return;return db[_0x083f('0x78')][_0x083f('0x5f')]({'where':{'id':_0x4c8957[_0x083f('0x5e')][_0x083f('0x66')],'role':_0x083f('0x67')},'attributes':['id',_0x083f('0x3f'),_0x083f('0x87'),_0x083f('0x88'),_0x083f('0x79')],'raw':!![]});}return null;})['then'](function(_0x376515){if(!_0x376515)return null;_0xffb386[_0x083f('0x2d')][_0x083f('0x67')]=_0x376515;return _0xffb386;})['then'](function(_0xf21f47){if(_0xf21f47){_0xf21f47['message'][_0x083f('0x7a')]=util[_0x083f('0x65')](_0x083f('0x7b'),_0x4c8957[_0x083f('0x6e')][_0x083f('0x3f')]);_0xf21f47[_0x083f('0x2d')][_0x083f('0x7c')]=_0xffb386[_0x083f('0x7c')];_0xf21f47[_0x083f('0x2d')][_0x083f('0x7d')]=_0xffb386[_0x083f('0x7c')];_0xf21f47[_0x083f('0x2d')][_0x083f('0x7e')]=_0x083f('0x3a');respondWithRpcPromise(_0x083f('0x7f'),_0x083f('0x7f'),{'event':_0x083f('0x89'),'message':_['merge'](_0xffb386[_0x083f('0x2d')],JSON[_0x083f('0x81')](_0xffb386[_0x083f('0x6c')][_0x083f('0x82')]))},client9002);return _0xffb386;}return null;})[_0x083f('0x25')](respondWithResult(_0x32725e,null))[_0x083f('0x30')](handleError(_0x32725e,null));};
\ No newline at end of file
+var _0x54b4=['sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','describe','../../config/logger','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','RejectMessage','rejectMessage','reject','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','save','then','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x12e634,_0x452df4){var _0x19e23d=function(_0x24cdcd){while(--_0x24cdcd){_0x12e634['push'](_0x12e634['shift']());}};_0x19e23d(++_0x452df4);}(_0x54b4,0xc9));var _0x454b=function(_0x23a1b5,_0x57f4cb){_0x23a1b5=_0x23a1b5-0x0;var _0x34e70b=_0x54b4[_0x23a1b5];return _0x34e70b;};'use strict';var emlformat=require(_0x454b('0x0'));var rimraf=require(_0x454b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x454b('0x2'));var rp=require(_0x454b('0x3'));var moment=require('moment');var BPromise=require(_0x454b('0x4'));var Mustache=require(_0x454b('0x5'));var util=require(_0x454b('0x6'));var path=require(_0x454b('0x7'));var sox=require(_0x454b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x454b('0x9'));var _=require('lodash');var squel=require(_0x454b('0xa'));var crypto=require(_0x454b('0xb'));var jsforce=require(_0x454b('0xc'));var deskjs=require(_0x454b('0xd'));var toCsv=require(_0x454b('0xe'));var querystring=require(_0x454b('0xf'));var Papa=require('papaparse');var Redis=require(_0x454b('0x10'));var authService=require(_0x454b('0x11'));var qs=require(_0x454b('0x12'));var as=require(_0x454b('0x13'));var hardwareService=require(_0x454b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x454b('0x15'));var config=require(_0x454b('0x16'));var licenseUtil=require(_0x454b('0x17'));var db=require(_0x454b('0x18'))['db'];config['redis']=_[_0x454b('0x19')](config[_0x454b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x454b('0x1b'))(new Redis(config['redis']));require(_0x454b('0x1c'))['register'](socket);var jayson=require(_0x454b('0x1d'));var client=jayson[_0x454b('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x454b('0x1e')][_0x454b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x8bea2f,_0x2914c2,_0x31788e,_0x14d1ab){return new BPromise(function(_0x12cd47,_0x44f748){var _0x23134=_0x14d1ab||client;return _0x23134[_0x454b('0x20')](_0x8bea2f,_0x31788e)['then'](function(_0x53a316){logger[_0x454b('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x454b('0x22'));logger[_0x454b('0x23')](_0x454b('0x24'),_0x2914c2,'request\x20sent',JSON[_0x454b('0x25')](_0x53a316));if(_0x53a316['error']){if(_0x53a316[_0x454b('0x26')][_0x454b('0x27')]===0x1f4){logger[_0x454b('0x26')](_0x454b('0x28'),_0x2914c2,_0x53a316[_0x454b('0x26')]['message']);return _0x44f748(_0x53a316[_0x454b('0x26')][_0x454b('0x29')]);}logger[_0x454b('0x26')](_0x454b('0x28'),_0x2914c2,_0x53a316['error'][_0x454b('0x29')]);return _0x12cd47(_0x53a316[_0x454b('0x26')][_0x454b('0x29')]);}else{logger[_0x454b('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x454b('0x22'));_0x12cd47(_0x53a316[_0x454b('0x2a')]['message']);}})[_0x454b('0x2b')](function(_0x5d2c09){logger[_0x454b('0x26')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x5d2c09);_0x44f748(_0x5d2c09);});});}function respondWithStatusCode(_0x4cd0fb,_0x54c38e){_0x54c38e=_0x54c38e||0xcc;return function(_0x4f1458){if(_0x4f1458){return _0x4cd0fb[_0x454b('0x2c')](_0x54c38e);}return _0x4cd0fb['status'](_0x54c38e)[_0x454b('0x2d')]();};}function respondWithResult(_0x474a69,_0x5c100b){_0x5c100b=_0x5c100b||0xc8;return function(_0xd2b082){if(_0xd2b082){return _0x474a69[_0x454b('0x2e')](_0x5c100b)[_0x454b('0x2f')](_0xd2b082);}};}function respondWithFilteredResult(_0x2f0ed8,_0x1eb774){return function(_0x5bda90){if(_0x5bda90){var _0x3f7e8a=typeof _0x1eb774[_0x454b('0x30')]==='undefined'&&typeof _0x1eb774[_0x454b('0x31')]===_0x454b('0x32');var _0x4147f3=_0x5bda90['count'];var _0x3ff96d=_0x3f7e8a?0x0:_0x1eb774[_0x454b('0x30')];var _0x1685b9=_0x3f7e8a?_0x5bda90['count']:_0x1eb774[_0x454b('0x30')]+_0x1eb774[_0x454b('0x31')];var _0x428f39;if(_0x1685b9>=_0x4147f3){_0x1685b9=_0x4147f3;_0x428f39=0xc8;}else{_0x428f39=0xce;}_0x2f0ed8[_0x454b('0x2e')](_0x428f39);return _0x2f0ed8[_0x454b('0x33')](_0x454b('0x34'),_0x3ff96d+'-'+_0x1685b9+'/'+_0x4147f3)[_0x454b('0x2f')](_0x5bda90);}return null;};}function patchUpdates(_0x20f73f){return function(_0x4e9678){try{jsonpatch[_0x454b('0x35')](_0x4e9678,_0x20f73f,!![]);}catch(_0x29b76c){return BPromise['reject'](_0x29b76c);}return _0x4e9678[_0x454b('0x36')]();};}function saveUpdates(_0x57da73,_0x480280){return function(_0x4a6b41){if(_0x4a6b41){return _0x4a6b41['update'](_0x57da73)[_0x454b('0x37')](function(_0x17f914){return _0x17f914;});}return null;};}function removeEntity(_0x4c9413,_0x56907e){return function(_0x7acfa7){if(_0x7acfa7){return _0x7acfa7['destroy']()['then'](function(){_0x4c9413['status'](0xcc)[_0x454b('0x2d')]();});}};}function handleEntityNotFound(_0x662a09,_0x52d453){return function(_0x495ab0){if(!_0x495ab0){_0x662a09['sendStatus'](0x194);}return _0x495ab0;};}function handleError(_0x5b6238,_0x4186fb){_0x4186fb=_0x4186fb||0x1f4;return function(_0x250ef4){logger[_0x454b('0x26')](_0x250ef4[_0x454b('0x38')]);if(_0x250ef4[_0x454b('0x39')]){delete _0x250ef4[_0x454b('0x39')];}_0x5b6238[_0x454b('0x2e')](_0x4186fb)[_0x454b('0x3a')](_0x250ef4);};}exports[_0x454b('0x3b')]=function(_0x3e533a,_0x41c317){var _0x323e0f={},_0x5dfbcd={},_0x51c85b={'count':0x0,'rows':[]};var _0x2d2980=_[_0x454b('0x3c')](db[_0x454b('0x3d')][_0x454b('0x3e')],function(_0x5d03a4){return{'name':_0x5d03a4['fieldName'],'type':_0x5d03a4[_0x454b('0x3f')][_0x454b('0x40')]};});_0x5dfbcd[_0x454b('0x41')]=_[_0x454b('0x3c')](_0x2d2980,_0x454b('0x39'));_0x5dfbcd[_0x454b('0x42')]=_[_0x454b('0x43')](_0x3e533a[_0x454b('0x42')]);_0x5dfbcd[_0x454b('0x44')]=_[_0x454b('0x45')](_0x5dfbcd['model'],_0x5dfbcd[_0x454b('0x42')]);_0x323e0f[_0x454b('0x46')]=_[_0x454b('0x45')](_0x5dfbcd[_0x454b('0x41')],qs[_0x454b('0x47')](_0x3e533a[_0x454b('0x42')]['fields']));_0x323e0f[_0x454b('0x46')]=_0x323e0f['attributes'][_0x454b('0x48')]?_0x323e0f[_0x454b('0x46')]:_0x5dfbcd[_0x454b('0x41')];if(!_0x3e533a['query']['hasOwnProperty'](_0x454b('0x49'))){_0x323e0f['limit']=qs[_0x454b('0x31')](_0x3e533a[_0x454b('0x42')][_0x454b('0x31')]);_0x323e0f[_0x454b('0x30')]=qs['offset'](_0x3e533a[_0x454b('0x42')][_0x454b('0x30')]);}_0x323e0f[_0x454b('0x4a')]=qs[_0x454b('0x4b')](_0x3e533a[_0x454b('0x42')][_0x454b('0x4b')]);_0x323e0f[_0x454b('0x4c')]=qs[_0x454b('0x44')](_[_0x454b('0x4d')](_0x3e533a[_0x454b('0x42')],_0x5dfbcd[_0x454b('0x44')]),_0x2d2980);if(_0x3e533a[_0x454b('0x42')][_0x454b('0x4e')]){_0x323e0f[_0x454b('0x4c')]=_[_0x454b('0x4f')](_0x323e0f[_0x454b('0x4c')],{'$or':_[_0x454b('0x3c')](_0x2d2980,function(_0x1a6740){if(_0x1a6740[_0x454b('0x3f')]!==_0x454b('0x50')){var _0x5d5490={};_0x5d5490[_0x1a6740[_0x454b('0x39')]]={'$like':'%'+_0x3e533a[_0x454b('0x42')][_0x454b('0x4e')]+'%'};return _0x5d5490;}})});}_0x323e0f=_[_0x454b('0x4f')]({},_0x323e0f,_0x3e533a[_0x454b('0x51')]);var _0x55ad74={'where':_0x323e0f['where']};return db['ChatMessage'][_0x454b('0x52')](_0x55ad74)[_0x454b('0x37')](function(_0x1bf3e6){_0x51c85b[_0x454b('0x52')]=_0x1bf3e6;if(_0x3e533a[_0x454b('0x42')][_0x454b('0x53')]){_0x323e0f[_0x454b('0x54')]=[{'all':!![]}];}return db['ChatMessage'][_0x454b('0x55')](_0x323e0f);})[_0x454b('0x37')](function(_0x313c1a){_0x51c85b[_0x454b('0x56')]=_0x313c1a;return _0x51c85b;})[_0x454b('0x37')](respondWithFilteredResult(_0x41c317,_0x323e0f))['catch'](handleError(_0x41c317,null));};exports[_0x454b('0x57')]=function(_0x31a844,_0x3d44a7){var _0xc5c195={'raw':!![],'where':{'id':_0x31a844[_0x454b('0x58')]['id']}},_0x32fd63={};_0x32fd63['model']=_[_0x454b('0x43')](db[_0x454b('0x3d')][_0x454b('0x3e')]);_0x32fd63[_0x454b('0x42')]=_['keys'](_0x31a844[_0x454b('0x42')]);_0x32fd63[_0x454b('0x44')]=_[_0x454b('0x45')](_0x32fd63['model'],_0x32fd63[_0x454b('0x42')]);_0xc5c195[_0x454b('0x46')]=_[_0x454b('0x45')](_0x32fd63[_0x454b('0x41')],qs[_0x454b('0x47')](_0x31a844[_0x454b('0x42')][_0x454b('0x47')]));_0xc5c195['attributes']=_0xc5c195[_0x454b('0x46')]['length']?_0xc5c195[_0x454b('0x46')]:_0x32fd63[_0x454b('0x41')];if(_0x31a844[_0x454b('0x42')][_0x454b('0x53')]){_0xc5c195['include']=[{'all':!![]}];}_0xc5c195=_[_0x454b('0x4f')]({},_0xc5c195,_0x31a844[_0x454b('0x51')]);return db[_0x454b('0x3d')][_0x454b('0x59')](_0xc5c195)['then'](handleEntityNotFound(_0x3d44a7,null))['then'](respondWithResult(_0x3d44a7,null))[_0x454b('0x2b')](handleError(_0x3d44a7,null));};exports[_0x454b('0x5a')]=function(_0x2e5cc0,_0x19ef79){return db[_0x454b('0x3d')][_0x454b('0x5a')](_0x2e5cc0[_0x454b('0x5b')],{})[_0x454b('0x37')](respondWithResult(_0x19ef79,0xc9))[_0x454b('0x2b')](handleError(_0x19ef79,null));};exports[_0x454b('0x5c')]=function(_0x190e48,_0x40e788){if(_0x190e48['body']['id']){delete _0x190e48[_0x454b('0x5b')]['id'];}return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x190e48['params']['id']}})[_0x454b('0x37')](handleEntityNotFound(_0x40e788,null))['then'](saveUpdates(_0x190e48[_0x454b('0x5b')],null))[_0x454b('0x37')](respondWithResult(_0x40e788,null))['catch'](handleError(_0x40e788,null));};exports[_0x454b('0x5d')]=function(_0x1764a6,_0x4e8bef){return db[_0x454b('0x3d')][_0x454b('0x59')]({'where':{'id':_0x1764a6[_0x454b('0x58')]['id']}})[_0x454b('0x37')](handleEntityNotFound(_0x4e8bef,null))['then'](removeEntity(_0x4e8bef,null))[_0x454b('0x2b')](handleError(_0x4e8bef,null));};exports[_0x454b('0x5e')]=function(_0x262c35,_0x445981){return db[_0x454b('0x3d')]['describe']()['then'](respondWithResult(_0x445981,null))['catch'](handleError(_0x445981,null));};var interaction_log=require(_0x454b('0x5f'))(_0x454b('0x60'));exports[_0x454b('0x61')]=function(_0x14ef9e,_0x304082,_0x4f08d0){var _0x4bdad3={'agent':{},'channel':'chat'};if(_0x14ef9e[_0x454b('0x5b')]['id']){delete _0x14ef9e['body']['id'];}_0x14ef9e[_0x454b('0x5b')]['read']=!![];_0x14ef9e['body'][_0x454b('0x62')]=moment()['format'](_0x454b('0x63'));_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')]=_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')]||_0x14ef9e[_0x454b('0x65')]['id'];_0x4bdad3['agent']['id']=_0x14ef9e[_0x454b('0x5b')]['UserId'];return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x14ef9e[_0x454b('0x58')]['id'],'UserId':null}})[_0x454b('0x37')](handleEntityNotFound(_0x304082,null))[_0x454b('0x37')](saveUpdates(_0x14ef9e[_0x454b('0x5b')],null))[_0x454b('0x37')](function(_0x93857c){if(_0x93857c){_0x4bdad3['message']=_0x93857c[_0x454b('0x66')]({'plain':!![]});return db[_0x454b('0x67')][_0x454b('0x59')]({'where':{'id':_0x93857c[_0x454b('0x68')]}});}return null;})[_0x454b('0x37')](handleEntityNotFound(_0x304082,null))[_0x454b('0x37')](function(_0x37d2a9){if(_0x37d2a9){return _0x37d2a9[_0x454b('0x5c')]({'UserId':_0x14ef9e['body'][_0x454b('0x64')],'read1stAt':_[_0x454b('0x69')](_0x37d2a9[_0x454b('0x6a')])?moment()[_0x454b('0x6b')](_0x454b('0x63')):undefined});}return null;})[_0x454b('0x37')](function(_0x44199f){if(_0x44199f){_0x4bdad3[_0x454b('0x6c')]=_0x44199f['get']({'plain':!![]});interaction_log['info'](_0x454b('0x6d'),_0x14ef9e[_0x454b('0x65')]['id'],_0x14ef9e[_0x454b('0x65')][_0x454b('0x39')],_0x14ef9e[_0x454b('0x65')][_0x454b('0x6e')],_0x4bdad3[_0x454b('0x6c')]['id'],_0x14ef9e[_0x454b('0x5b')]?JSON[_0x454b('0x25')](_0x14ef9e[_0x454b('0x5b')]):_0x454b('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x454b('0x70'),_0x4bdad3);}return null;})[_0x454b('0x37')](function(_0x181e36){var _0x3db2b0=_0x454b('0x71')+_0x181e36[_0x454b('0x29')][_0x454b('0x72')];return db[_0x454b('0x73')]['query'](_0x3db2b0,{'type':db[_0x454b('0x74')][_0x454b('0x75')][_0x454b('0x76')],'raw':!![]})[_0x454b('0x37')](function(_0x1d6be3){return _0x1d6be3;});})['then'](function(_0x34c651){if(_0x34c651){_0x4bdad3[_0x454b('0x29')][_0x454b('0x77')]=_0x34c651[0x0];if(!_0x14ef9e[_0x454b('0x5b')]['UserId'])return;return db[_0x454b('0x78')][_0x454b('0x59')]({'where':{'id':_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')],'role':_0x454b('0x79')},'attributes':['id',_0x454b('0x39'),_0x454b('0x7a'),_0x454b('0x7b'),_0x454b('0x7c')],'raw':!![]});}return null;})[_0x454b('0x37')](function(_0x179cb8){if(!_0x179cb8)return null;_0x4bdad3[_0x454b('0x29')][_0x454b('0x79')]=_0x179cb8;return _0x4bdad3;})[_0x454b('0x37')](function(_0x5c54ae){if(_0x5c54ae){if(_0x14ef9e[_0x454b('0x5b')]['manual']){_0x4bdad3[_0x454b('0x29')][_0x454b('0x7d')]=util['format'](_0x454b('0x7e'),_0x14ef9e[_0x454b('0x65')][_0x454b('0x39')]);_0x4bdad3['message']['channel']=_0x4bdad3[_0x454b('0x7f')];_0x4bdad3['message'][_0x454b('0x80')]=_0x4bdad3[_0x454b('0x7f')];_0x4bdad3[_0x454b('0x29')][_0x454b('0x81')]=_0x454b('0x61');return respondWithRpcPromise(_0x454b('0x82'),_0x454b('0x82'),{'event':_0x454b('0x83'),'message':_[_0x454b('0x4f')](_0x4bdad3[_0x454b('0x29')],JSON['parse'](_0x4bdad3[_0x454b('0x6c')][_0x454b('0x84')]))},client9002)[_0x454b('0x37')](function(){return _0x4bdad3;});}return _0x4bdad3;}return null;})['then'](respondWithResult(_0x304082,null))[_0x454b('0x2b')](handleError(_0x304082,null));};var interaction_log=require('../../config/logger')(_0x454b('0x60'));exports['reject']=function(_0x5a9b65,_0xd0bdbb,_0x1a90be){var _0x1b5ca8={'agent':{},'channel':_0x454b('0x85')};if(_0x5a9b65[_0x454b('0x5b')]['id']){delete _0x5a9b65[_0x454b('0x5b')]['id'];}_0x5a9b65[_0x454b('0x5b')][_0x454b('0x64')]=_0x5a9b65['body'][_0x454b('0x64')]||_0x5a9b65[_0x454b('0x65')]['id'];_0x1b5ca8[_0x454b('0x79')]['id']=_0x5a9b65['body'][_0x454b('0x64')];return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x5a9b65[_0x454b('0x58')]['id'],'UserId':null}})[_0x454b('0x37')](handleEntityNotFound(_0xd0bdbb,null))[_0x454b('0x37')](function(_0x4a858c){if(_0x4a858c){_0x1b5ca8[_0x454b('0x29')]=_0x4a858c[_0x454b('0x66')]({'plain':!![]});return db[_0x454b('0x67')][_0x454b('0x59')]({'where':{'id':_0x4a858c[_0x454b('0x68')]}});}return null;})[_0x454b('0x37')](handleEntityNotFound(_0xd0bdbb,null))[_0x454b('0x37')](function(_0x5a4c9d){if(_0x5a4c9d){_0x1b5ca8[_0x454b('0x6c')]=_0x5a4c9d[_0x454b('0x66')]({'plain':!![]});interaction_log[_0x454b('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5a9b65['user']['id'],_0x5a9b65[_0x454b('0x65')][_0x454b('0x39')],_0x5a9b65[_0x454b('0x65')][_0x454b('0x6e')],_0x1b5ca8[_0x454b('0x6c')]['id'],_0x5a9b65['body']?JSON['stringify'](_0x5a9b65[_0x454b('0x5b')]):_0x454b('0x6f'));return respondWithRpcPromise(_0x454b('0x86'),_0x454b('0x87'),_0x1b5ca8);}return null;})[_0x454b('0x37')](function(_0x59527c){var _0x4858e8=_0x454b('0x71')+_0x59527c[_0x454b('0x29')]['ContactId'];return db[_0x454b('0x73')][_0x454b('0x42')](_0x4858e8,{'type':db[_0x454b('0x74')][_0x454b('0x75')]['SELECT'],'raw':!![]})[_0x454b('0x37')](function(_0x51f7e8){return _0x51f7e8;});})[_0x454b('0x37')](function(_0x5beb6f){if(_0x5beb6f){_0x1b5ca8[_0x454b('0x29')][_0x454b('0x77')]=_0x5beb6f[0x0];if(!_0x5a9b65[_0x454b('0x5b')]['UserId'])return;return db[_0x454b('0x78')][_0x454b('0x59')]({'where':{'id':_0x5a9b65[_0x454b('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0x454b('0x39'),'fullname',_0x454b('0x7b'),_0x454b('0x7c')],'raw':!![]});}return null;})[_0x454b('0x37')](function(_0xa9e1e){if(!_0xa9e1e)return null;_0x1b5ca8['message'][_0x454b('0x79')]=_0xa9e1e;return _0x1b5ca8;})[_0x454b('0x37')](function(_0x4140c4){if(_0x4140c4){_0x4140c4[_0x454b('0x29')][_0x454b('0x7d')]=util[_0x454b('0x6b')](_0x454b('0x7e'),_0x5a9b65[_0x454b('0x65')]['name']);_0x4140c4[_0x454b('0x29')][_0x454b('0x7f')]=_0x1b5ca8['channel'];_0x4140c4['message'][_0x454b('0x80')]=_0x1b5ca8[_0x454b('0x7f')];_0x4140c4[_0x454b('0x29')]['event']=_0x454b('0x88');respondWithRpcPromise('EventManager','EventManager',{'event':_0x454b('0x89'),'message':_['merge'](_0x1b5ca8[_0x454b('0x29')],JSON['parse'](_0x1b5ca8['interaction'][_0x454b('0x84')]))},client9002);return _0x1b5ca8;}return null;})[_0x454b('0x37')](respondWithResult(_0xd0bdbb,null))[_0x454b('0x2b')](handleError(_0xd0bdbb,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 29b0c21..01d6875 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 _0xd47e=['hook','exports','events','ChatMessage','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x43576f,_0x1356ed){var _0x4d2466=function(_0x865deb){while(--_0x865deb){_0x43576f['push'](_0x43576f['shift']());}};_0x4d2466(++_0x1356ed);}(_0xd47e,0x134));var _0xed47=function(_0x464e93,_0x3f5e20){_0x464e93=_0x464e93-0x0;var _0x18e264=_0xd47e[_0x464e93];return _0x18e264;};'use strict';var EventEmitter=require(_0xed47('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xed47('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xed47('0x2')](0x0);var events={'afterCreate':_0xed47('0x3'),'afterUpdate':_0xed47('0x4'),'afterDestroy':_0xed47('0x5')};function emitEvent(_0x2fe77e){return function(_0x574cb6,_0x1a72fc,_0xea4bb9){ChatMessageEvents['emit'](_0x2fe77e+':'+_0x574cb6['id'],_0x574cb6);ChatMessageEvents['emit'](_0x2fe77e,_0x574cb6);_0xea4bb9(null);};}for(var e in events){if(events[_0xed47('0x6')](e)){var event=events[e];ChatMessage[_0xed47('0x7')](e,emitEvent(event));}}module[_0xed47('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xfac0=['exports','../../mysqldb','ChatMessage','setMaxListeners','remove','hasOwnProperty'];(function(_0x23408e,_0x17bdce){var _0x58f607=function(_0x3f587d){while(--_0x3f587d){_0x23408e['push'](_0x23408e['shift']());}};_0x58f607(++_0x17bdce);}(_0xfac0,0x19f));var _0x0fac=function(_0xe24fb7,_0x1b4d12){_0xe24fb7=_0xe24fb7-0x0;var _0x56b975=_0xfac0[_0xe24fb7];return _0x56b975;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0fac('0x0'))['db'][_0x0fac('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0fac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0fac('0x3')};function emitEvent(_0x311b37){return function(_0x52425a,_0xeae09a,_0x18ef54){ChatMessageEvents['emit'](_0x311b37+':'+_0x52425a['id'],_0x52425a);ChatMessageEvents['emit'](_0x311b37,_0x52425a);_0x18ef54(null);};}for(var e in events){if(events[_0x0fac('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x0fac('0x5')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 595b633..932f3b3 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 _0xbd5c=['UserId','ChatInteraction','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','out','secret'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbd5c,0x19d));var _0xcbd5=function(_0xf6d197,_0x948e12){_0xf6d197=_0xf6d197-0x0;var _0x420255=_0xbd5c[_0xf6d197];return _0x420255;};'use strict';var _=require(_0xcbd5('0x0'));var util=require(_0xcbd5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcbd5('0x2'));var BPromise=require(_0xcbd5('0x3'));var rp=require(_0xcbd5('0x4'));var fs=require('fs');var path=require(_0xcbd5('0x5'));var rimraf=require(_0xcbd5('0x6'));var config=require(_0xcbd5('0x7'));var attributes=require(_0xcbd5('0x8'));module[_0xcbd5('0x9')]=function(_0x389aaa,_0xb2e08){return _0x389aaa['define'](_0xcbd5('0xa'),attributes,{'tableName':_0xcbd5('0xb'),'paranoid':![],'indexes':[{'name':_0xcbd5('0xc'),'fields':[_0xcbd5('0xd')],'type':_0xcbd5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f12c0,_0x52cf5b,_0x431e3f){var _0x5f45ba=_0x389aaa[_0xcbd5('0xf')];var _0x6a7fe2=_0x4f12c0['get']({'plain':!![]});if(_0x6a7fe2['direction']['toLowerCase']()==='in'||_0x6a7fe2[_0xcbd5('0x10')]['toLowerCase']()===_0xcbd5('0x11')&&!_0x6a7fe2[_0xcbd5('0x12')]&&!_['isNil'](_0x6a7fe2[_0xcbd5('0x13')])){_0x5f45ba[_0xcbd5('0x14')]['findOne']({'where':{'id':_0x6a7fe2['ChatInteractionId']}})['then'](function(_0x1af92a){if(_0x1af92a){_0x1af92a['update']({'lastMsgAt':_0x6a7fe2['createdAt'],'lastMsgDirection':_0x6a7fe2[_0xcbd5('0x10')]['toLowerCase']()});}})['catch'](function(_0x235c81){console[_0xcbd5('0x15')](_0x235c81);});}_0x431e3f();}},'charset':_0xcbd5('0x16'),'collate':_0xcbd5('0x17')});};
\ No newline at end of file
+var _0x4318=['then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x47c566,_0x280943){var _0x5693c7=function(_0x4e07c9){while(--_0x4e07c9){_0x47c566['push'](_0x47c566['shift']());}};_0x5693c7(++_0x280943);}(_0x4318,0x1a7));var _0x8431=function(_0x3e7a4e,_0xe67c15){_0x3e7a4e=_0x3e7a4e-0x0;var _0x5912e1=_0x4318[_0x3e7a4e];return _0x5912e1;};'use strict';var _=require(_0x8431('0x0'));var util=require(_0x8431('0x1'));var logger=require(_0x8431('0x2'))(_0x8431('0x3'));var moment=require(_0x8431('0x4'));var BPromise=require(_0x8431('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8431('0x6'));var rimraf=require(_0x8431('0x7'));var config=require(_0x8431('0x8'));var attributes=require('./chatMessage.attributes');module[_0x8431('0x9')]=function(_0x391150,_0x35b031){return _0x391150[_0x8431('0xa')](_0x8431('0xb'),attributes,{'tableName':_0x8431('0xc'),'paranoid':![],'indexes':[{'name':_0x8431('0xd'),'fields':['body'],'type':_0x8431('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a22ae,_0x14d241,_0x17f4da){var _0x5c3360=_0x391150[_0x8431('0xf')];var _0xd90f8a=_0x4a22ae[_0x8431('0x10')]({'plain':!![]});if(_0xd90f8a[_0x8431('0x11')][_0x8431('0x12')]()==='in'||_0xd90f8a[_0x8431('0x11')][_0x8431('0x12')]()===_0x8431('0x13')&&!_0xd90f8a[_0x8431('0x14')]&&!_['isNil'](_0xd90f8a[_0x8431('0x15')])){_0x5c3360[_0x8431('0x16')][_0x8431('0x17')]({'where':{'id':_0xd90f8a[_0x8431('0x18')]}})[_0x8431('0x19')](function(_0x47cbac){if(_0x47cbac){_0x47cbac[_0x8431('0x1a')]({'lastMsgAt':_0xd90f8a[_0x8431('0x1b')],'lastMsgDirection':_0xd90f8a[_0x8431('0x11')]['toLowerCase']()});}})[_0x8431('0x1c')](function(_0x5718af){console[_0x8431('0x1d')](_0x5718af);});}_0x17f4da();}},'charset':_0x8431('0x1e'),'collate':_0x8431('0x1f')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index b313515..1bc7972 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 _0x184a=['message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x58b9b2,_0x4a3098){var _0x215fb5=function(_0x70e8d3){while(--_0x70e8d3){_0x58b9b2['push'](_0x58b9b2['shift']());}};_0x215fb5(++_0x4a3098);}(_0x184a,0x16b));var _0xa184=function(_0x26fe83,_0x29110){_0x26fe83=_0x26fe83-0x0;var _0x41b15f=_0x184a[_0x26fe83];return _0x41b15f;};'use strict';var _=require(_0xa184('0x0'));var util=require('util');var moment=require(_0xa184('0x1'));var BPromise=require(_0xa184('0x2'));var rs=require(_0xa184('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa184('0x4'))['db'];var utils=require(_0xa184('0x5'));var logger=require(_0xa184('0x6'))(_0xa184('0x7'));var config=require(_0xa184('0x8'));var jayson=require(_0xa184('0x9'));var client=jayson[_0xa184('0xa')]['http']({'port':0x232a});config[_0xa184('0xb')]=_['defaults'](config[_0xa184('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa184('0xb')]));require('./chatMessage.socket')[_0xa184('0xc')](socket);function respondWithRpcPromise(_0x54e82e,_0x5d7adf,_0xa9bbf6){return new BPromise(function(_0x3ee8e1,_0x1bdac7){return client[_0xa184('0xd')](_0x54e82e,_0xa9bbf6)[_0xa184('0xe')](function(_0x1e3d9e){logger['info'](_0xa184('0xf'),_0x5d7adf,_0xa184('0x10'));logger[_0xa184('0x11')](_0xa184('0x12'),_0x5d7adf,_0xa184('0x10'),JSON['stringify'](_0x1e3d9e));if(_0x1e3d9e[_0xa184('0x13')]){if(_0x1e3d9e['error'][_0xa184('0x14')]===0x1f4){logger['error'](_0xa184('0xf'),_0x5d7adf,_0x1e3d9e[_0xa184('0x13')]['message']);return _0x1bdac7(_0x1e3d9e[_0xa184('0x13')][_0xa184('0x15')]);}logger[_0xa184('0x13')](_0xa184('0xf'),_0x5d7adf,_0x1e3d9e[_0xa184('0x13')][_0xa184('0x15')]);return _0x3ee8e1(_0x1e3d9e['error'][_0xa184('0x15')]);}else{logger[_0xa184('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5d7adf,_0xa184('0x10'));_0x3ee8e1(_0x1e3d9e[_0xa184('0x17')][_0xa184('0x15')]);}})[_0xa184('0x18')](function(_0x11d91e){logger[_0xa184('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5d7adf,_0x11d91e);_0x1bdac7(_0x11d91e);});});}exports[_0xa184('0x19')]=function(_0x67496e){var _0x5d210c=this;return new Promise(function(_0x58d70e,_0x24b71e){return db[_0xa184('0x1a')][_0xa184('0x1b')](_0x67496e[_0xa184('0x1c')],{'raw':_0x67496e[_0xa184('0x1d')]?_0x67496e[_0xa184('0x1d')][_0xa184('0x1e')]===undefined?!![]:![]:!![]})[_0xa184('0xe')](function(_0x2c4a11){logger['info'](_0xa184('0x19'),_0x67496e);logger[_0xa184('0x11')]('CreateChatMessage',_0x67496e,JSON[_0xa184('0x1f')](_0x2c4a11));_0x58d70e(_0x2c4a11);})[_0xa184('0x18')](function(_0x2a0ec8){logger[_0xa184('0x13')](_0xa184('0x19'),_0x2a0ec8['message'],_0x67496e);_0x24b71e(_0x5d210c[_0xa184('0x13')](0x1f4,_0x2a0ec8[_0xa184('0x15')]));});});};
\ No newline at end of file
+var _0x8524=['result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1c41dd,_0x542e1c){var _0x3b54c7=function(_0x3b00c2){while(--_0x3b00c2){_0x1c41dd['push'](_0x1c41dd['shift']());}};_0x3b54c7(++_0x542e1c);}(_0x8524,0x84));var _0x4852=function(_0x17eb95,_0x25527a){_0x17eb95=_0x17eb95-0x0;var _0x311877=_0x8524[_0x17eb95];return _0x311877;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4852('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4852('0x1'));var db=require(_0x4852('0x2'))['db'];var utils=require(_0x4852('0x3'));var logger=require(_0x4852('0x4'))(_0x4852('0x5'));var config=require('../../config/environment');var jayson=require(_0x4852('0x6'));var client=jayson[_0x4852('0x7')][_0x4852('0x8')]({'port':0x232a});config[_0x4852('0x9')]=_[_0x4852('0xa')](config[_0x4852('0x9')],{'host':_0x4852('0xb'),'port':0x18eb});var socket=require(_0x4852('0xc'))(new Redis(config[_0x4852('0x9')]));require(_0x4852('0xd'))['register'](socket);function respondWithRpcPromise(_0x173eee,_0x3fdb83,_0x376582){return new BPromise(function(_0x28da5d,_0x54c66f){return client[_0x4852('0xe')](_0x173eee,_0x376582)['then'](function(_0x56739e){logger[_0x4852('0xf')](_0x4852('0x10'),_0x3fdb83,_0x4852('0x11'));logger[_0x4852('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3fdb83,_0x4852('0x11'),JSON[_0x4852('0x13')](_0x56739e));if(_0x56739e['error']){if(_0x56739e[_0x4852('0x14')][_0x4852('0x15')]===0x1f4){logger['error'](_0x4852('0x10'),_0x3fdb83,_0x56739e[_0x4852('0x14')]['message']);return _0x54c66f(_0x56739e['error']['message']);}logger[_0x4852('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3fdb83,_0x56739e[_0x4852('0x14')][_0x4852('0x16')]);return _0x28da5d(_0x56739e[_0x4852('0x14')][_0x4852('0x16')]);}else{logger['info'](_0x4852('0x10'),_0x3fdb83,_0x4852('0x11'));_0x28da5d(_0x56739e[_0x4852('0x17')][_0x4852('0x16')]);}})[_0x4852('0x18')](function(_0x4201b7){logger[_0x4852('0x14')](_0x4852('0x10'),_0x3fdb83,_0x4201b7);_0x54c66f(_0x4201b7);});});}exports[_0x4852('0x19')]=function(_0x416c79){var _0x41a143=this;return new Promise(function(_0x748a93,_0x5c9ff1){return db[_0x4852('0x1a')][_0x4852('0x1b')](_0x416c79[_0x4852('0x1c')],{'raw':_0x416c79[_0x4852('0x1d')]?_0x416c79[_0x4852('0x1d')][_0x4852('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x251d0c){logger['info']('CreateChatMessage',_0x416c79);logger[_0x4852('0x12')](_0x4852('0x19'),_0x416c79,JSON[_0x4852('0x13')](_0x251d0c));_0x748a93(_0x251d0c);})['catch'](function(_0x5bfc7c){logger[_0x4852('0x14')](_0x4852('0x19'),_0x5bfc7c['message'],_0x416c79);_0x5c9ff1(_0x41a143[_0x4852('0x14')](0x1f4,_0x5bfc7c[_0x4852('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 70b4ea4..221f143 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 _0xdd0c=['save','remove','update','emit','removeListener','register','length'];(function(_0x42c2f7,_0x16bbdd){var _0x55c3ae=function(_0x24502f){while(--_0x24502f){_0x42c2f7['push'](_0x42c2f7['shift']());}};_0x55c3ae(++_0x16bbdd);}(_0xdd0c,0x165));var _0xcdd0=function(_0x491fcf,_0x450f7f){_0x491fcf=_0x491fcf-0x0;var _0x5b65f1=_0xdd0c[_0x491fcf];return _0x5b65f1;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xcdd0('0x0'),_0xcdd0('0x1'),_0xcdd0('0x2')];function createListener(_0x5e3ada,_0xe8ed9){return function(_0x5b86cb){_0xe8ed9[_0xcdd0('0x3')](_0x5e3ada,_0x5b86cb);};}function removeListener(_0x159e38,_0x432716){return function(){ChatMessageEvents[_0xcdd0('0x4')](_0x159e38,_0x432716);};}exports[_0xcdd0('0x5')]=function(_0x5ae472){for(var _0x2b33fc=0x0,_0x1b6f5d=events[_0xcdd0('0x6')];_0x2b33fc<_0x1b6f5d;_0x2b33fc++){var _0x15c402=events[_0x2b33fc];var _0x337496=createListener('chatMessage:'+_0x15c402,_0x5ae472);ChatMessageEvents['on'](_0x15c402,_0x337496);}};
\ No newline at end of file
+var _0x8ba0=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x1b2bda,_0x11c750){var _0x5d955b=function(_0x2ae5fb){while(--_0x2ae5fb){_0x1b2bda['push'](_0x1b2bda['shift']());}};_0x5d955b(++_0x11c750);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x7ab04c,_0x3a7791){_0x7ab04c=_0x7ab04c-0x0;var _0x14add2=_0x8ba0[_0x7ab04c];return _0x14add2;};'use strict';var ChatMessageEvents=require(_0x08ba('0x0'));var events=[_0x08ba('0x1'),_0x08ba('0x2'),_0x08ba('0x3')];function createListener(_0x43ffb6,_0x5684f1){return function(_0x5e182a){_0x5684f1[_0x08ba('0x4')](_0x43ffb6,_0x5e182a);};}function removeListener(_0x802b7e,_0x3defcd){return function(){ChatMessageEvents[_0x08ba('0x5')](_0x802b7e,_0x3defcd);};}exports[_0x08ba('0x6')]=function(_0x161a9d){for(var _0x5f29fa=0x0,_0x235354=events[_0x08ba('0x7')];_0x5f29fa<_0x235354;_0x5f29fa++){var _0x37bcdf=events[_0x5f29fa];var _0x451f15=createListener(_0x08ba('0x8')+_0x37bcdf,_0x161a9d);ChatMessageEvents['on'](_0x37bcdf,_0x451f15);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index a8e9f7b..5606afc 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 _0x5a61=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a61,0x6b));var _0x15a6=function(_0x3e103d,_0x55790c){_0x3e103d=_0x3e103d-0x0;var _0x4931bf=_0x5a61[_0x3e103d];return _0x4931bf;};'use strict';var multer=require(_0x15a6('0x0'));var util=require('util');var path=require(_0x15a6('0x1'));var timeout=require(_0x15a6('0x2'));var express=require(_0x15a6('0x3'));var router=express[_0x15a6('0x4')]();var fs_extra=require(_0x15a6('0x5'));var auth=require(_0x15a6('0x6'));var interaction=require(_0x15a6('0x7'));var config=require(_0x15a6('0x8'));var controller=require(_0x15a6('0x9'));router[_0x15a6('0xa')]('/',auth[_0x15a6('0xb')](),controller[_0x15a6('0xc')]);router[_0x15a6('0xa')](_0x15a6('0xd'),auth[_0x15a6('0xb')](),controller[_0x15a6('0xe')]);router[_0x15a6('0xa')](_0x15a6('0xf'),auth[_0x15a6('0xb')](),controller['show']);router[_0x15a6('0x10')]('/',auth[_0x15a6('0xb')](),interaction[_0x15a6('0x11')](_0x15a6('0x12'),_0x15a6('0x13')),controller['create']);router[_0x15a6('0x14')](_0x15a6('0xf'),controller[_0x15a6('0x15')]);router[_0x15a6('0x14')](_0x15a6('0x16'),auth[_0x15a6('0xb')](),controller[_0x15a6('0x17')]);router[_0x15a6('0x14')](_0x15a6('0x18'),auth[_0x15a6('0xb')](),controller[_0x15a6('0x19')]);router[_0x15a6('0x1a')](_0x15a6('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa172=['create','put','/:id/accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked'];(function(_0x2c66b3,_0x4ecbd1){var _0x14527e=function(_0x167b4a){while(--_0x167b4a){_0x2c66b3['push'](_0x2c66b3['shift']());}};_0x14527e(++_0x4ecbd1);}(_0xa172,0x1d2));var _0x2a17=function(_0x4e9208,_0x3e7809){_0x4e9208=_0x4e9208-0x0;var _0x32a86f=_0xa172[_0x4e9208];return _0x32a86f;};'use strict';var multer=require(_0x2a17('0x0'));var util=require(_0x2a17('0x1'));var path=require(_0x2a17('0x2'));var timeout=require(_0x2a17('0x3'));var express=require(_0x2a17('0x4'));var router=express['Router']();var fs_extra=require(_0x2a17('0x5'));var auth=require(_0x2a17('0x6'));var interaction=require(_0x2a17('0x7'));var config=require(_0x2a17('0x8'));var controller=require(_0x2a17('0x9'));router['get']('/',auth[_0x2a17('0xa')](),controller[_0x2a17('0xb')]);router[_0x2a17('0xc')](_0x2a17('0xd'),auth[_0x2a17('0xa')](),controller[_0x2a17('0xe')]);router[_0x2a17('0xc')](_0x2a17('0xf'),auth[_0x2a17('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x2a17('0x10')]('chat','chatmessage:create'),controller[_0x2a17('0x11')]);router[_0x2a17('0x12')]('/:id',controller['update']);router[_0x2a17('0x12')](_0x2a17('0x13'),auth[_0x2a17('0xa')](),controller['accept']);router['put'](_0x2a17('0x14'),auth[_0x2a17('0xa')](),controller[_0x2a17('0x15')]);router[_0x2a17('0x16')](_0x2a17('0xf'),auth[_0x2a17('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 379f1c2..c3165bb 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 _0xadb5=['medium','TEXT','exports'];(function(_0x184abf,_0x1bd5d2){var _0x4954a4=function(_0x600bf7){while(--_0x600bf7){_0x184abf['push'](_0x184abf['shift']());}};_0x4954a4(++_0x1bd5d2);}(_0xadb5,0xad));var _0x5adb=function(_0x3b59c0,_0x13a0bd){_0x3b59c0=_0x3b59c0-0x0;var _0x1e2e25=_0xadb5[_0x3b59c0];return _0x1e2e25;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x2eed97,_0x2f9a2a){var _0x260c3c=function(_0x39967d){while(--_0x39967d){_0x2eed97['push'](_0x2eed97['shift']());}};_0x260c3c(++_0x2f9a2a);}(_0xdb28,0x106));var _0x8db2=function(_0x3b0e21,_0x29d3bb){_0x3b0e21=_0x3b0e21-0x0;var _0x344841=_0xdb28[_0x3b0e21];return _0x344841;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 79f692c..8a9a07e 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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x5e7f9f,_0x2de81a){_0x5e7f9f=_0x5e7f9f-0x0;var _0x2afd1b=_0x7a54[_0x5e7f9f];return _0x2afd1b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));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 licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1f0cc0,_0x1e9eec){var _0x477658=function(_0x38fd09){while(--_0x38fd09){_0x1f0cc0['push'](_0x1f0cc0['shift']());}};_0x477658(++_0x1e9eec);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));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 licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index e4994bc..2f279d3 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x847f=['emit','exports','events','../../mysqldb','ChatOfflineMessage','save','update','remove'];(function(_0x30c0a8,_0xfe54a1){var _0x17a034=function(_0x585a6f){while(--_0x585a6f){_0x30c0a8['push'](_0x30c0a8['shift']());}};_0x17a034(++_0xfe54a1);}(_0x847f,0x182));var _0xf847=function(_0x3705f7,_0x2553c4){_0x3705f7=_0x3705f7-0x0;var _0x2a1cf2=_0x847f[_0x3705f7];return _0x2a1cf2;};'use strict';var EventEmitter=require(_0xf847('0x0'));var ChatOfflineMessage=require(_0xf847('0x1'))['db'][_0xf847('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf847('0x3'),'afterUpdate':_0xf847('0x4'),'afterDestroy':_0xf847('0x5')};function emitEvent(_0x2e0f72){return function(_0x12faa2,_0x5d5964,_0x5eeab2){ChatOfflineMessageEvents[_0xf847('0x6')](_0x2e0f72+':'+_0x12faa2['id'],_0x12faa2);ChatOfflineMessageEvents[_0xf847('0x6')](_0x2e0f72,_0x12faa2);_0x5eeab2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xf847('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x54c7=['hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x332e95,_0x2d5ef2){var _0x387cb1=function(_0x168886){while(--_0x168886){_0x332e95['push'](_0x332e95['shift']());}};_0x387cb1(++_0x2d5ef2);}(_0x54c7,0x161));var _0x754c=function(_0x1ef2ac,_0x2589fd){_0x1ef2ac=_0x1ef2ac-0x0;var _0x30ca2d=_0x54c7[_0x1ef2ac];return _0x30ca2d;};'use strict';var EventEmitter=require(_0x754c('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x754c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x754c('0x2')](0x0);var events={'afterCreate':_0x754c('0x3'),'afterUpdate':_0x754c('0x4'),'afterDestroy':_0x754c('0x5')};function emitEvent(_0x4bb46c){return function(_0x5000a8,_0x4a028d,_0x338ac1){ChatOfflineMessageEvents[_0x754c('0x6')](_0x4bb46c+':'+_0x5000a8['id'],_0x5000a8);ChatOfflineMessageEvents['emit'](_0x4bb46c,_0x5000a8);_0x338ac1(null);};}for(var e in events){if(events[_0x754c('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x754c('0x8')](e,emitEvent(event));}}module[_0x754c('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f45c349..4580b20 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 _0x9a43=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x9a43,0x96));var _0x39a4=function(_0x15a833,_0x5092d6){_0x15a833=_0x15a833-0x0;var _0x371593=_0x9a43[_0x15a833];return _0x371593;};'use strict';var attributes=require(_0x39a4('0x0'));module[_0x39a4('0x1')]=function(_0x3cac99){return _0x3cac99[_0x39a4('0x2')](_0x39a4('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39a4('0x4'),'collate':_0x39a4('0x5')});};
\ No newline at end of file
+var _0x165e=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x165e,0xd3));var _0xe165=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x165e[_0x3d8ba1];return _0x87804e;};'use strict';var attributes=require(_0xe165('0x0'));module['exports']=function(_0x19b26b){return _0x19b26b[_0xe165('0x1')](_0xe165('0x2'),attributes,{'tableName':_0xe165('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe165('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index a13f82f..13d4ca8 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 _0x21d1=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment'];(function(_0x4029b1,_0x4a2674){var _0x27ac22=function(_0x500e25){while(--_0x500e25){_0x4029b1['push'](_0x4029b1['shift']());}};_0x27ac22(++_0x4a2674);}(_0x21d1,0x1c9));var _0x121d=function(_0x5a13ec,_0x431fd7){_0x5a13ec=_0x5a13ec-0x0;var _0x27fd53=_0x21d1[_0x5a13ec];return _0x27fd53;};'use strict';var _=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var moment=require(_0x121d('0x2'));var BPromise=require(_0x121d('0x3'));var rs=require(_0x121d('0x4'));var fs=require('fs');var Redis=require(_0x121d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x121d('0x6'))(_0x121d('0x7'));var config=require(_0x121d('0x8'));var jayson=require(_0x121d('0x9'));var client=jayson[_0x121d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x226625,_0x2bd1e8,_0x47b50b){return new BPromise(function(_0x2d4d7e,_0x242f0c){return client[_0x121d('0xb')](_0x226625,_0x47b50b)[_0x121d('0xc')](function(_0x8b07c2){logger[_0x121d('0xd')](_0x121d('0xe'),_0x2bd1e8,'request\x20sent');logger[_0x121d('0xf')](_0x121d('0x10'),_0x2bd1e8,_0x121d('0x11'),JSON['stringify'](_0x8b07c2));if(_0x8b07c2['error']){if(_0x8b07c2[_0x121d('0x12')][_0x121d('0x13')]===0x1f4){logger[_0x121d('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2bd1e8,_0x8b07c2['error'][_0x121d('0x14')]);return _0x242f0c(_0x8b07c2['error'][_0x121d('0x14')]);}logger[_0x121d('0x12')](_0x121d('0xe'),_0x2bd1e8,_0x8b07c2['error'][_0x121d('0x14')]);return _0x2d4d7e(_0x8b07c2[_0x121d('0x12')][_0x121d('0x14')]);}else{logger[_0x121d('0xd')](_0x121d('0xe'),_0x2bd1e8,_0x121d('0x11'));_0x2d4d7e(_0x8b07c2[_0x121d('0x15')][_0x121d('0x14')]);}})[_0x121d('0x16')](function(_0x475541){logger[_0x121d('0x12')](_0x121d('0xe'),_0x2bd1e8,_0x475541);_0x242f0c(_0x475541);});});}
\ No newline at end of file
+var _0x13e3=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0x13e3,0x137));var _0x313e=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x13e3[_0x1d80be];return _0xf9a4f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x313e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x313e('0x1'));var db=require(_0x313e('0x2'))['db'];var utils=require(_0x313e('0x3'));var logger=require(_0x313e('0x4'))('rpc');var config=require(_0x313e('0x5'));var jayson=require(_0x313e('0x6'));var client=jayson[_0x313e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x65b347,_0x1fb2da,_0x5439c2){return new BPromise(function(_0x5cd7a0,_0x572930){return client[_0x313e('0x8')](_0x65b347,_0x5439c2)[_0x313e('0x9')](function(_0x1dbff1){logger[_0x313e('0xa')](_0x313e('0xb'),_0x1fb2da,_0x313e('0xc'));logger['debug'](_0x313e('0xd'),_0x1fb2da,_0x313e('0xc'),JSON['stringify'](_0x1dbff1));if(_0x1dbff1[_0x313e('0xe')]){if(_0x1dbff1[_0x313e('0xe')]['code']===0x1f4){logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);return _0x572930(_0x1dbff1[_0x313e('0xe')]['message']);}logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);return _0x5cd7a0(_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);}else{logger[_0x313e('0xa')](_0x313e('0xb'),_0x1fb2da,_0x313e('0xc'));_0x5cd7a0(_0x1dbff1[_0x313e('0x10')]['message']);}})[_0x313e('0x11')](function(_0xb404d3){logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0xb404d3);_0x572930(_0xb404d3);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 2afdb2f..35d73e4 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 _0xc88d=['update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc88d,0x1be));var _0xdc88=function(_0x49f371,_0x5a4f84){_0x49f371=_0x49f371-0x0;var _0x101bd9=_0xc88d[_0x49f371];return _0x101bd9;};'use strict';var multer=require('multer');var util=require(_0xdc88('0x0'));var path=require(_0xdc88('0x1'));var timeout=require(_0xdc88('0x2'));var express=require(_0xdc88('0x3'));var router=express[_0xdc88('0x4')]();var fs_extra=require(_0xdc88('0x5'));var auth=require(_0xdc88('0x6'));var interaction=require(_0xdc88('0x7'));var config=require(_0xdc88('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0xdc88('0x9')]('/',auth[_0xdc88('0xa')](),controller[_0xdc88('0xb')]);router[_0xdc88('0x9')]('/describe',auth[_0xdc88('0xa')](),controller['describe']);router['get']('/:id',auth[_0xdc88('0xa')](),controller[_0xdc88('0xc')]);router[_0xdc88('0xd')]('/',auth[_0xdc88('0xa')](),controller[_0xdc88('0xe')]);router[_0xdc88('0xf')]('/:id',auth[_0xdc88('0xa')](),controller[_0xdc88('0x10')]);router[_0xdc88('0x11')](_0xdc88('0x12'),auth[_0xdc88('0xa')](),controller[_0xdc88('0x13')]);module[_0xdc88('0x14')]=router;
\ No newline at end of file
+var _0x1fa6=['/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe'];(function(_0x589d2f,_0xc49372){var _0x1db27c=function(_0x25d0d3){while(--_0x25d0d3){_0x589d2f['push'](_0x589d2f['shift']());}};_0x1db27c(++_0xc49372);}(_0x1fa6,0x12d));var _0x61fa=function(_0x5e6d6b,_0x12c0f0){_0x5e6d6b=_0x5e6d6b-0x0;var _0xea6381=_0x1fa6[_0x5e6d6b];return _0xea6381;};'use strict';var multer=require(_0x61fa('0x0'));var util=require(_0x61fa('0x1'));var path=require(_0x61fa('0x2'));var timeout=require(_0x61fa('0x3'));var express=require(_0x61fa('0x4'));var router=express['Router']();var fs_extra=require(_0x61fa('0x5'));var auth=require(_0x61fa('0x6'));var interaction=require(_0x61fa('0x7'));var config=require(_0x61fa('0x8'));var controller=require(_0x61fa('0x9'));router[_0x61fa('0xa')]('/',auth[_0x61fa('0xb')](),controller[_0x61fa('0xc')]);router[_0x61fa('0xa')]('/describe',auth[_0x61fa('0xb')](),controller[_0x61fa('0xd')]);router['get'](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0xf')]);router[_0x61fa('0x10')]('/',auth[_0x61fa('0xb')](),controller[_0x61fa('0x11')]);router['put'](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0x12')]);router[_0x61fa('0x13')](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index b184d70..4db8bcb 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 _0x665d=['ENUM','mouseOver','timeout','sequelize','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x665d,0x12f));var _0xd665=function(_0x57aec1,_0x2b6744){_0x57aec1=_0x57aec1-0x0;var _0x4597ae=_0x665d[_0x57aec1];return _0x4597ae;};'use strict';var Sequelize=require(_0xd665('0x0'));module[_0xd665('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd665('0x2')](_0xd665('0x3'),_0xd665('0x4')),'defaultValue':_0xd665('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xae29=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x594c55,_0x2bf942){var _0x4801a5=function(_0x52a288){while(--_0x52a288){_0x594c55['push'](_0x594c55['shift']());}};_0x4801a5(++_0x2bf942);}(_0xae29,0xf3));var _0x9ae2=function(_0xada429,_0xdb476b){_0xada429=_0xada429-0x0;var _0x4d8c6d=_0xae29[_0xada429];return _0x4d8c6d;};'use strict';var Sequelize=require(_0x9ae2('0x0'));module[_0x9ae2('0x1')]={'name':{'type':Sequelize[_0x9ae2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9ae2('0x3')](_0x9ae2('0x4'),_0x9ae2('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x9ae2('0x2')]},'timeout':{'type':Sequelize[_0x9ae2('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 40421a5..45eed99 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 _0x4e00=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','end','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','catch','params','destroy','rimraf','fast-json-patch','request-promise','mustache','path'];(function(_0x213ba1,_0x35c70f){var _0x192447=function(_0x5b5968){while(--_0x5b5968){_0x213ba1['push'](_0x213ba1['shift']());}};_0x192447(++_0x35c70f);}(_0x4e00,0xa0));var _0x04e0=function(_0x4b6bb4,_0x205fd3){_0x4b6bb4=_0x4b6bb4-0x0;var _0x53b2f6=_0x4e00[_0x4b6bb4];return _0x53b2f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04e0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04e0('0x1'));var rp=require(_0x04e0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x04e0('0x3'));var util=require('util');var path=require(_0x04e0('0x4'));var sox=require(_0x04e0('0x5'));var csv=require(_0x04e0('0x6'));var ejs=require(_0x04e0('0x7'));var fs=require('fs');var fs_extra=require(_0x04e0('0x8'));var _=require(_0x04e0('0x9'));var squel=require(_0x04e0('0xa'));var crypto=require('crypto');var jsforce=require(_0x04e0('0xb'));var deskjs=require(_0x04e0('0xc'));var toCsv=require(_0x04e0('0x6'));var querystring=require(_0x04e0('0xd'));var Papa=require('papaparse');var Redis=require(_0x04e0('0xe'));var authService=require(_0x04e0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04e0('0x10'));var logger=require('../../config/logger')(_0x04e0('0x11'));var utils=require(_0x04e0('0x12'));var config=require(_0x04e0('0x13'));var licenseUtil=require(_0x04e0('0x14'));var db=require(_0x04e0('0x15'))['db'];function respondWithStatusCode(_0xc0ae61,_0x2a620a){_0x2a620a=_0x2a620a||0xcc;return function(_0x323881){if(_0x323881){return _0xc0ae61['sendStatus'](_0x2a620a);}return _0xc0ae61[_0x04e0('0x16')](_0x2a620a)['end']();};}function respondWithResult(_0x1963cf,_0x29f682){_0x29f682=_0x29f682||0xc8;return function(_0xdf6702){if(_0xdf6702){return _0x1963cf['status'](_0x29f682)[_0x04e0('0x17')](_0xdf6702);}};}function respondWithFilteredResult(_0x3823f6,_0x2e28a5){return function(_0x221c66){if(_0x221c66){var _0x462cf7=typeof _0x2e28a5[_0x04e0('0x18')]===_0x04e0('0x19')&&typeof _0x2e28a5[_0x04e0('0x1a')]===_0x04e0('0x19');var _0xf7b102=_0x221c66[_0x04e0('0x1b')];var _0x1b6f4a=_0x462cf7?0x0:_0x2e28a5[_0x04e0('0x18')];var _0x5bdd6c=_0x462cf7?_0x221c66['count']:_0x2e28a5['offset']+_0x2e28a5[_0x04e0('0x1a')];var _0x3e940e;if(_0x5bdd6c>=_0xf7b102){_0x5bdd6c=_0xf7b102;_0x3e940e=0xc8;}else{_0x3e940e=0xce;}_0x3823f6[_0x04e0('0x16')](_0x3e940e);return _0x3823f6['set'](_0x04e0('0x1c'),_0x1b6f4a+'-'+_0x5bdd6c+'/'+_0xf7b102)[_0x04e0('0x17')](_0x221c66);}return null;};}function patchUpdates(_0x27e761){return function(_0x7bc646){try{jsonpatch['apply'](_0x7bc646,_0x27e761,!![]);}catch(_0x4fdbc4){return BPromise[_0x04e0('0x1d')](_0x4fdbc4);}return _0x7bc646[_0x04e0('0x1e')]();};}function saveUpdates(_0x34e44c,_0x310473){return function(_0x9e9020){if(_0x9e9020){return _0x9e9020[_0x04e0('0x1f')](_0x34e44c)[_0x04e0('0x20')](function(_0x3c3f69){return _0x3c3f69;});}return null;};}function removeEntity(_0x4566e2,_0x133b27){return function(_0x30decd){if(_0x30decd){return _0x30decd['destroy']()[_0x04e0('0x20')](function(){_0x4566e2[_0x04e0('0x16')](0xcc)[_0x04e0('0x21')]();});}};}function handleEntityNotFound(_0x2f47e1,_0x207c4c){return function(_0x50416c){if(!_0x50416c){_0x2f47e1['sendStatus'](0x194);}return _0x50416c;};}function handleError(_0x1ec359,_0x47e3be){_0x47e3be=_0x47e3be||0x1f4;return function(_0x11e64c){logger['error'](_0x11e64c['stack']);if(_0x11e64c[_0x04e0('0x22')]){delete _0x11e64c[_0x04e0('0x22')];}_0x1ec359[_0x04e0('0x16')](_0x47e3be)[_0x04e0('0x23')](_0x11e64c);};}exports[_0x04e0('0x24')]=function(_0x748569,_0xafde85){var _0x383a94={'raw':!![],'where':{'id':_0x748569['params']['id']}},_0xce81d5={};_0xce81d5[_0x04e0('0x25')]=_[_0x04e0('0x26')](db[_0x04e0('0x27')][_0x04e0('0x28')]);_0xce81d5[_0x04e0('0x29')]=_[_0x04e0('0x26')](_0x748569[_0x04e0('0x29')]);_0xce81d5['filters']=_[_0x04e0('0x2a')](_0xce81d5[_0x04e0('0x25')],_0xce81d5['query']);_0x383a94[_0x04e0('0x2b')]=_[_0x04e0('0x2a')](_0xce81d5[_0x04e0('0x25')],qs[_0x04e0('0x2c')](_0x748569[_0x04e0('0x29')]['fields']));_0x383a94['attributes']=_0x383a94[_0x04e0('0x2b')][_0x04e0('0x2d')]?_0x383a94[_0x04e0('0x2b')]:_0xce81d5[_0x04e0('0x25')];if(_0x748569[_0x04e0('0x29')][_0x04e0('0x2e')]){_0x383a94['include']=[{'all':!![]}];}_0x383a94=_[_0x04e0('0x2f')]({},_0x383a94,_0x748569[_0x04e0('0x30')]);return db['ChatProactiveAction'][_0x04e0('0x31')](_0x383a94)[_0x04e0('0x20')](handleEntityNotFound(_0xafde85,null))['then'](respondWithResult(_0xafde85,null))['catch'](handleError(_0xafde85,null));};exports[_0x04e0('0x32')]=function(_0xba549a,_0x3f29de){return db[_0x04e0('0x27')][_0x04e0('0x32')](_0xba549a[_0x04e0('0x33')],{})['then'](respondWithResult(_0x3f29de,0xc9))[_0x04e0('0x34')](handleError(_0x3f29de,null));};exports[_0x04e0('0x1f')]=function(_0xe3af2a,_0x4956b5){if(_0xe3af2a[_0x04e0('0x33')]['id']){delete _0xe3af2a[_0x04e0('0x33')]['id'];}return db[_0x04e0('0x27')][_0x04e0('0x31')]({'where':{'id':_0xe3af2a[_0x04e0('0x35')]['id']}})[_0x04e0('0x20')](handleEntityNotFound(_0x4956b5,null))[_0x04e0('0x20')](saveUpdates(_0xe3af2a[_0x04e0('0x33')],null))['then'](respondWithResult(_0x4956b5,null))['catch'](handleError(_0x4956b5,null));};exports[_0x04e0('0x36')]=function(_0x573755,_0x2a4595){return db[_0x04e0('0x27')][_0x04e0('0x31')]({'where':{'id':_0x573755['params']['id']}})['then'](handleEntityNotFound(_0x2a4595,null))[_0x04e0('0x20')](removeEntity(_0x2a4595,null))['catch'](handleError(_0x2a4595,null));};
\ No newline at end of file
+var _0xa276=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','find','catch','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x2bad0d,_0x1a99c9){var _0x69f1e1=function(_0x152a30){while(--_0x152a30){_0x2bad0d['push'](_0x2bad0d['shift']());}};_0x69f1e1(++_0x1a99c9);}(_0xa276,0x9a));var _0x6a27=function(_0xd1f83b,_0xc10512){_0xd1f83b=_0xd1f83b-0x0;var _0x548b09=_0xa276[_0xd1f83b];return _0x548b09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a27('0x0'));var zipdir=require(_0x6a27('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a27('0x2'));var moment=require(_0x6a27('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a27('0x4'));var util=require(_0x6a27('0x5'));var path=require(_0x6a27('0x6'));var sox=require('sox');var csv=require(_0x6a27('0x7'));var ejs=require(_0x6a27('0x8'));var fs=require('fs');var fs_extra=require(_0x6a27('0x9'));var _=require('lodash');var squel=require(_0x6a27('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a27('0xb'));var Papa=require(_0x6a27('0xc'));var Redis=require(_0x6a27('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a27('0xe'));var hardwareService=require(_0x6a27('0xf'));var logger=require(_0x6a27('0x10'))(_0x6a27('0x11'));var utils=require(_0x6a27('0x12'));var config=require(_0x6a27('0x13'));var licenseUtil=require(_0x6a27('0x14'));var db=require(_0x6a27('0x15'))['db'];function respondWithStatusCode(_0x394307,_0x4a7209){_0x4a7209=_0x4a7209||0xcc;return function(_0x96472c){if(_0x96472c){return _0x394307['sendStatus'](_0x4a7209);}return _0x394307['status'](_0x4a7209)[_0x6a27('0x16')]();};}function respondWithResult(_0x1e987f,_0x39ef85){_0x39ef85=_0x39ef85||0xc8;return function(_0x5b28c6){if(_0x5b28c6){return _0x1e987f[_0x6a27('0x17')](_0x39ef85)[_0x6a27('0x18')](_0x5b28c6);}};}function respondWithFilteredResult(_0x318b61,_0x8f297b){return function(_0x294ac7){if(_0x294ac7){var _0x523e6d=typeof _0x8f297b['offset']===_0x6a27('0x19')&&typeof _0x8f297b[_0x6a27('0x1a')]===_0x6a27('0x19');var _0x4339d3=_0x294ac7[_0x6a27('0x1b')];var _0x1d5925=_0x523e6d?0x0:_0x8f297b['offset'];var _0x3fd414=_0x523e6d?_0x294ac7[_0x6a27('0x1b')]:_0x8f297b[_0x6a27('0x1c')]+_0x8f297b[_0x6a27('0x1a')];var _0x50ddcc;if(_0x3fd414>=_0x4339d3){_0x3fd414=_0x4339d3;_0x50ddcc=0xc8;}else{_0x50ddcc=0xce;}_0x318b61[_0x6a27('0x17')](_0x50ddcc);return _0x318b61[_0x6a27('0x1d')](_0x6a27('0x1e'),_0x1d5925+'-'+_0x3fd414+'/'+_0x4339d3)[_0x6a27('0x18')](_0x294ac7);}return null;};}function patchUpdates(_0x57649a){return function(_0x531d60){try{jsonpatch[_0x6a27('0x1f')](_0x531d60,_0x57649a,!![]);}catch(_0x4231c3){return BPromise['reject'](_0x4231c3);}return _0x531d60[_0x6a27('0x20')]();};}function saveUpdates(_0x2a7fdf,_0x13fc15){return function(_0x167076){if(_0x167076){return _0x167076[_0x6a27('0x21')](_0x2a7fdf)[_0x6a27('0x22')](function(_0x29348c){return _0x29348c;});}return null;};}function removeEntity(_0x13e148,_0x5e3a2e){return function(_0x241029){if(_0x241029){return _0x241029[_0x6a27('0x23')]()[_0x6a27('0x22')](function(){_0x13e148[_0x6a27('0x17')](0xcc)[_0x6a27('0x16')]();});}};}function handleEntityNotFound(_0x5f4897,_0x5b725c){return function(_0x30454b){if(!_0x30454b){_0x5f4897[_0x6a27('0x24')](0x194);}return _0x30454b;};}function handleError(_0x73dc52,_0x354781){_0x354781=_0x354781||0x1f4;return function(_0x54fc6c){logger[_0x6a27('0x25')](_0x54fc6c['stack']);if(_0x54fc6c['name']){delete _0x54fc6c[_0x6a27('0x26')];}_0x73dc52[_0x6a27('0x17')](_0x354781)['send'](_0x54fc6c);};}exports[_0x6a27('0x27')]=function(_0x52cc5d,_0x35fe1c){var _0xa42f9c={'raw':!![],'where':{'id':_0x52cc5d[_0x6a27('0x28')]['id']}},_0x5140b2={};_0x5140b2[_0x6a27('0x29')]=_[_0x6a27('0x2a')](db[_0x6a27('0x2b')][_0x6a27('0x2c')]);_0x5140b2[_0x6a27('0x2d')]=_[_0x6a27('0x2a')](_0x52cc5d[_0x6a27('0x2d')]);_0x5140b2['filters']=_[_0x6a27('0x2e')](_0x5140b2[_0x6a27('0x29')],_0x5140b2[_0x6a27('0x2d')]);_0xa42f9c[_0x6a27('0x2f')]=_['intersection'](_0x5140b2['model'],qs[_0x6a27('0x30')](_0x52cc5d['query'][_0x6a27('0x30')]));_0xa42f9c[_0x6a27('0x2f')]=_0xa42f9c[_0x6a27('0x2f')][_0x6a27('0x31')]?_0xa42f9c[_0x6a27('0x2f')]:_0x5140b2[_0x6a27('0x29')];if(_0x52cc5d[_0x6a27('0x2d')][_0x6a27('0x32')]){_0xa42f9c['include']=[{'all':!![]}];}_0xa42f9c=_[_0x6a27('0x33')]({},_0xa42f9c,_0x52cc5d['options']);return db[_0x6a27('0x2b')][_0x6a27('0x34')](_0xa42f9c)[_0x6a27('0x22')](handleEntityNotFound(_0x35fe1c,null))[_0x6a27('0x22')](respondWithResult(_0x35fe1c,null))[_0x6a27('0x35')](handleError(_0x35fe1c,null));};exports['create']=function(_0xabaac8,_0x316bb5){return db['ChatProactiveAction']['create'](_0xabaac8[_0x6a27('0x36')],{})[_0x6a27('0x22')](respondWithResult(_0x316bb5,0xc9))[_0x6a27('0x35')](handleError(_0x316bb5,null));};exports[_0x6a27('0x21')]=function(_0x1d9c1c,_0x3c3ad2){if(_0x1d9c1c['body']['id']){delete _0x1d9c1c[_0x6a27('0x36')]['id'];}return db['ChatProactiveAction'][_0x6a27('0x34')]({'where':{'id':_0x1d9c1c[_0x6a27('0x28')]['id']}})[_0x6a27('0x22')](handleEntityNotFound(_0x3c3ad2,null))[_0x6a27('0x22')](saveUpdates(_0x1d9c1c[_0x6a27('0x36')],null))[_0x6a27('0x22')](respondWithResult(_0x3c3ad2,null))[_0x6a27('0x35')](handleError(_0x3c3ad2,null));};exports[_0x6a27('0x23')]=function(_0x55020d,_0x43c9f3){return db['ChatProactiveAction']['find']({'where':{'id':_0x55020d[_0x6a27('0x28')]['id']}})[_0x6a27('0x22')](handleEntityNotFound(_0x43c9f3,null))[_0x6a27('0x22')](removeEntity(_0x43c9f3,null))[_0x6a27('0x35')](handleError(_0x43c9f3,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index f724e62..0e22242 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 _0x65ac=['util','../../config/logger','bluebird','exports','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x417577,_0x53d563){var _0x19db92=function(_0x4adc94){while(--_0x4adc94){_0x417577['push'](_0x417577['shift']());}};_0x19db92(++_0x53d563);}(_0x65ac,0x1bf));var _0xc65a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x65ac[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xc65a('0x0'));var util=require(_0xc65a('0x1'));var logger=require(_0xc65a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc65a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xc65a('0x4')]=function(_0x21af0c,_0x4c9227){return _0x21af0c['define'](_0xc65a('0x5'),attributes,{'tableName':_0xc65a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf51=['chat_proactive_actions','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1abe5a,_0x3be795){var _0x54d205=function(_0x3c31f6){while(--_0x3c31f6){_0x1abe5a['push'](_0x1abe5a['shift']());}};_0x54d205(++_0x3be795);}(_0xbf51,0x12d));var _0x1bf5=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xbf51[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x1bf5('0x0'));var util=require(_0x1bf5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1bf5('0x2'));var rp=require(_0x1bf5('0x3'));var fs=require('fs');var path=require(_0x1bf5('0x4'));var rimraf=require(_0x1bf5('0x5'));var config=require(_0x1bf5('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x1bf5('0x7')]=function(_0x3eeaa3,_0x1d2f49){return _0x3eeaa3[_0x1bf5('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x1bf5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 73cc141..4d3dccd 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 _0x652f=['http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x652f,0xbd));var _0xf652=function(_0x5bdb03,_0x12c8f4){_0x5bdb03=_0x5bdb03-0x0;var _0x34b89c=_0x652f[_0x5bdb03];return _0x34b89c;};'use strict';var _=require(_0xf652('0x0'));var util=require(_0xf652('0x1'));var moment=require(_0xf652('0x2'));var BPromise=require(_0xf652('0x3'));var rs=require(_0xf652('0x4'));var fs=require('fs');var Redis=require(_0xf652('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf652('0x6'));var logger=require(_0xf652('0x7'))('rpc');var config=require(_0xf652('0x8'));var jayson=require(_0xf652('0x9'));var client=jayson[_0xf652('0xa')][_0xf652('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd0fc,_0x2af39a,_0x372b47){return new BPromise(function(_0x19768a,_0x7b48b6){return client[_0xf652('0xc')](_0x5bd0fc,_0x372b47)[_0xf652('0xd')](function(_0x41e850){logger[_0xf652('0xe')](_0xf652('0xf'),_0x2af39a,_0xf652('0x10'));logger[_0xf652('0x11')](_0xf652('0x12'),_0x2af39a,_0xf652('0x10'),JSON[_0xf652('0x13')](_0x41e850));if(_0x41e850['error']){if(_0x41e850[_0xf652('0x14')][_0xf652('0x15')]===0x1f4){logger[_0xf652('0x14')](_0xf652('0xf'),_0x2af39a,_0x41e850[_0xf652('0x14')][_0xf652('0x16')]);return _0x7b48b6(_0x41e850[_0xf652('0x14')]['message']);}logger[_0xf652('0x14')](_0xf652('0xf'),_0x2af39a,_0x41e850[_0xf652('0x14')]['message']);return _0x19768a(_0x41e850[_0xf652('0x14')][_0xf652('0x16')]);}else{logger[_0xf652('0xe')](_0xf652('0xf'),_0x2af39a,_0xf652('0x10'));_0x19768a(_0x41e850[_0xf652('0x17')]['message']);}})[_0xf652('0x18')](function(_0x443d6f){logger[_0xf652('0x14')](_0xf652('0xf'),_0x2af39a,_0x443d6f);_0x7b48b6(_0x443d6f);});});}
\ No newline at end of file
+var _0x9220=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','ChatProactiveAction,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x52f2eb,_0x138336){var _0x3e344d=function(_0x2a7b7b){while(--_0x2a7b7b){_0x52f2eb['push'](_0x52f2eb['shift']());}};_0x3e344d(++_0x138336);}(_0x9220,0x162));var _0x0922=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9220[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x0922('0x0'));var util=require(_0x0922('0x1'));var moment=require(_0x0922('0x2'));var BPromise=require(_0x0922('0x3'));var rs=require(_0x0922('0x4'));var fs=require('fs');var Redis=require(_0x0922('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0922('0x6'));var logger=require(_0x0922('0x7'))(_0x0922('0x8'));var config=require(_0x0922('0x9'));var jayson=require(_0x0922('0xa'));var client=jayson[_0x0922('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x591d6c,_0x48ce8a,_0x41ba28){return new BPromise(function(_0x10cfb5,_0x33b528){return client[_0x0922('0xc')](_0x591d6c,_0x41ba28)[_0x0922('0xd')](function(_0xa849e){logger[_0x0922('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x48ce8a,'request\x20sent');logger[_0x0922('0xf')](_0x0922('0x10'),_0x48ce8a,_0x0922('0x11'),JSON[_0x0922('0x12')](_0xa849e));if(_0xa849e['error']){if(_0xa849e['error']['code']===0x1f4){logger['error'](_0x0922('0x13'),_0x48ce8a,_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);return _0x33b528(_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);}logger[_0x0922('0x14')](_0x0922('0x13'),_0x48ce8a,_0xa849e['error'][_0x0922('0x15')]);return _0x10cfb5(_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);}else{logger['info'](_0x0922('0x13'),_0x48ce8a,_0x0922('0x11'));_0x10cfb5(_0xa849e[_0x0922('0x16')][_0x0922('0x15')]);}})[_0x0922('0x17')](function(_0x4c0e44){logger[_0x0922('0x14')](_0x0922('0x13'),_0x48ce8a,_0x4c0e44);_0x33b528(_0x4c0e44);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 5f50634..6dabcc0 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 _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x43da18,_0x4c4521){var _0x5d72c5=function(_0x2ee73d){while(--_0x2ee73d){_0x43da18['push'](_0x43da18['shift']());}};_0x5d72c5(++_0x4c4521);}(_0x032e,0x124));var _0xe032=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x032e[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
+var _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x330a10,_0x32a371){var _0x1d0b53=function(_0x596911){while(--_0x596911){_0x330a10['push'](_0x330a10['shift']());}};_0x1d0b53(++_0x32a371);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x24ca[_0x5b7788];return _0x573871;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 3f24331..3f3c579 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 _0xd0c4=['exports','STRING','INTEGER','rrmemory','beepall','sequelize'];(function(_0xa8c155,_0x216e02){var _0x1e43cf=function(_0x38ec39){while(--_0x38ec39){_0xa8c155['push'](_0xa8c155['shift']());}};_0x1e43cf(++_0x216e02);}(_0xd0c4,0xd7));var _0x4d0c=function(_0x1ccb6b,_0x4e91e6){_0x1ccb6b=_0x1ccb6b-0x0;var _0x4c316=_0xd0c4[_0x1ccb6b];return _0x4c316;};'use strict';var Sequelize=require(_0x4d0c('0x0'));module[_0x4d0c('0x1')]={'name':{'type':Sequelize[_0x4d0c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4d0c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4d0c('0x4'),_0x4d0c('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x86d4=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory'];(function(_0x32e77d,_0x46cb63){var _0x583d3f=function(_0x30b4dc){while(--_0x30b4dc){_0x32e77d['push'](_0x32e77d['shift']());}};_0x583d3f(++_0x46cb63);}(_0x86d4,0x6d));var _0x486d=function(_0xa197e5,_0x574530){_0xa197e5=_0xa197e5-0x0;var _0xcea285=_0x86d4[_0xa197e5];return _0xcea285;};'use strict';var Sequelize=require(_0x486d('0x0'));module[_0x486d('0x1')]={'name':{'type':Sequelize[_0x486d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x486d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x486d('0x4'),'beepall',_0x486d('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f778b87..0c31d30 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 _0xc5dc=['lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','ChatQueue','includeAll','include','findAll','rows','show','params','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra'];(function(_0x33a8ee,_0x572c3a){var _0x39f415=function(_0x47078a){while(--_0x47078a){_0x33a8ee['push'](_0x33a8ee['shift']());}};_0x39f415(++_0x572c3a);}(_0xc5dc,0x128));var _0xcc5d=function(_0x748ad0,_0x4cac46){_0x748ad0=_0x748ad0-0x0;var _0xe98ad4=_0xc5dc[_0x748ad0];return _0xe98ad4;};'use strict';var emlformat=require(_0xcc5d('0x0'));var rimraf=require(_0xcc5d('0x1'));var zipdir=require(_0xcc5d('0x2'));var jsonpatch=require(_0xcc5d('0x3'));var rp=require(_0xcc5d('0x4'));var moment=require(_0xcc5d('0x5'));var BPromise=require(_0xcc5d('0x6'));var Mustache=require(_0xcc5d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xcc5d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc5d('0x9'));var _=require(_0xcc5d('0xa'));var squel=require(_0xcc5d('0xb'));var crypto=require(_0xcc5d('0xc'));var jsforce=require(_0xcc5d('0xd'));var deskjs=require(_0xcc5d('0xe'));var toCsv=require(_0xcc5d('0xf'));var querystring=require('querystring');var Papa=require(_0xcc5d('0x10'));var Redis=require(_0xcc5d('0x11'));var authService=require(_0xcc5d('0x12'));var qs=require(_0xcc5d('0x13'));var as=require(_0xcc5d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcc5d('0x15'))['db'];config['redis']=_[_0xcc5d('0x16')](config[_0xcc5d('0x17')],{'host':_0xcc5d('0x18'),'port':0x18eb});var socket=require(_0xcc5d('0x19'))(new Redis(config[_0xcc5d('0x17')]));require(_0xcc5d('0x1a'))['register'](socket);var jayson=require(_0xcc5d('0x1b'));var client=jayson[_0xcc5d('0x1c')][_0xcc5d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x10a9ce,_0x2820d7,_0x56e666,_0x5a1071){return new BPromise(function(_0x2f8c87,_0xf610c9){var _0x2bfa9f=_0x5a1071||client;return _0x2bfa9f[_0xcc5d('0x1e')](_0x10a9ce,_0x56e666)[_0xcc5d('0x1f')](function(_0xba7c4d){logger[_0xcc5d('0x20')](_0xcc5d('0x21'),_0x2820d7,_0xcc5d('0x22'));logger[_0xcc5d('0x23')](_0xcc5d('0x24'),_0x2820d7,_0xcc5d('0x22'),JSON['stringify'](_0xba7c4d));if(_0xba7c4d[_0xcc5d('0x25')]){if(_0xba7c4d['error'][_0xcc5d('0x26')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2820d7,_0xba7c4d[_0xcc5d('0x25')][_0xcc5d('0x27')]);return _0xf610c9(_0xba7c4d[_0xcc5d('0x25')][_0xcc5d('0x27')]);}logger[_0xcc5d('0x25')](_0xcc5d('0x21'),_0x2820d7,_0xba7c4d[_0xcc5d('0x25')]['message']);return _0x2f8c87(_0xba7c4d[_0xcc5d('0x25')]['message']);}else{logger['info'](_0xcc5d('0x21'),_0x2820d7,_0xcc5d('0x22'));_0x2f8c87(_0xba7c4d[_0xcc5d('0x28')][_0xcc5d('0x27')]);}})['catch'](function(_0x2279f9){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2820d7,_0x2279f9);_0xf610c9(_0x2279f9);});});}function respondWithStatusCode(_0x511bc8,_0x4043e0){_0x4043e0=_0x4043e0||0xcc;return function(_0xb1d23c){if(_0xb1d23c){return _0x511bc8[_0xcc5d('0x29')](_0x4043e0);}return _0x511bc8['status'](_0x4043e0)[_0xcc5d('0x2a')]();};}function respondWithResult(_0x5ac238,_0x365dd4){_0x365dd4=_0x365dd4||0xc8;return function(_0x52162b){if(_0x52162b){return _0x5ac238[_0xcc5d('0x2b')](_0x365dd4)[_0xcc5d('0x2c')](_0x52162b);}};}function respondWithFilteredResult(_0x1d5dd9,_0x4cd204){return function(_0x24ef39){if(_0x24ef39){var _0x517d3e=typeof _0x4cd204[_0xcc5d('0x2d')]===_0xcc5d('0x2e')&&typeof _0x4cd204[_0xcc5d('0x2f')]===_0xcc5d('0x2e');var _0xf9b1b7=_0x24ef39[_0xcc5d('0x30')];var _0xe98f3a=_0x517d3e?0x0:_0x4cd204[_0xcc5d('0x2d')];var _0x2a091c=_0x517d3e?_0x24ef39[_0xcc5d('0x30')]:_0x4cd204[_0xcc5d('0x2d')]+_0x4cd204['limit'];var _0x266270;if(_0x2a091c>=_0xf9b1b7){_0x2a091c=_0xf9b1b7;_0x266270=0xc8;}else{_0x266270=0xce;}_0x1d5dd9[_0xcc5d('0x2b')](_0x266270);return _0x1d5dd9[_0xcc5d('0x31')](_0xcc5d('0x32'),_0xe98f3a+'-'+_0x2a091c+'/'+_0xf9b1b7)[_0xcc5d('0x2c')](_0x24ef39);}return null;};}function patchUpdates(_0x163c74){return function(_0x178566){try{jsonpatch[_0xcc5d('0x33')](_0x178566,_0x163c74,!![]);}catch(_0x1eb06e){return BPromise[_0xcc5d('0x34')](_0x1eb06e);}return _0x178566['save']();};}function saveUpdates(_0xabd69f,_0x6c5a8){return function(_0x94ee5b){if(_0x94ee5b){return _0x94ee5b[_0xcc5d('0x35')](_0xabd69f)[_0xcc5d('0x1f')](function(_0x1dc12b){return _0x1dc12b;});}return null;};}function removeEntity(_0x2cacf9,_0x777bed){return function(_0x4f14b0){if(_0x4f14b0){return _0x4f14b0[_0xcc5d('0x36')]()['then'](function(){var _0x7023ce=_0x4f14b0[_0xcc5d('0x37')]({'plain':!![]});var _0x2fc952=_0xcc5d('0x38');return db['UserProfileResource'][_0xcc5d('0x36')]({'where':{'type':_0x2fc952,'resourceId':_0x7023ce['id']}})[_0xcc5d('0x1f')](function(){return _0x4f14b0;});})[_0xcc5d('0x1f')](function(){_0x2cacf9[_0xcc5d('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4471,_0x1fc7fd){return function(_0xe7dd77){if(!_0xe7dd77){_0x2d4471[_0xcc5d('0x29')](0x194);}return _0xe7dd77;};}function handleError(_0x4a0bbb,_0x306209){_0x306209=_0x306209||0x1f4;return function(_0x27ba13){logger[_0xcc5d('0x25')](_0x27ba13[_0xcc5d('0x39')]);if(_0x27ba13['name']){delete _0x27ba13[_0xcc5d('0x3a')];}_0x4a0bbb[_0xcc5d('0x2b')](_0x306209)[_0xcc5d('0x3b')](_0x27ba13);};}exports[_0xcc5d('0x3c')]=function(_0xf8019b,_0x110b0d){var _0x4246c3={},_0x27c0e1={},_0x390983={'count':0x0,'rows':[]};var _0x121da4=_['map'](db['ChatQueue'][_0xcc5d('0x3d')],function(_0x4596c8){return{'name':_0x4596c8[_0xcc5d('0x3e')],'type':_0x4596c8[_0xcc5d('0x3f')][_0xcc5d('0x40')]};});_0x27c0e1['model']=_[_0xcc5d('0x41')](_0x121da4,_0xcc5d('0x3a'));_0x27c0e1[_0xcc5d('0x42')]=_[_0xcc5d('0x43')](_0xf8019b['query']);_0x27c0e1[_0xcc5d('0x44')]=_[_0xcc5d('0x45')](_0x27c0e1[_0xcc5d('0x46')],_0x27c0e1['query']);_0x4246c3['attributes']=_[_0xcc5d('0x45')](_0x27c0e1[_0xcc5d('0x46')],qs[_0xcc5d('0x47')](_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x4246c3[_0xcc5d('0x48')]=_0x4246c3[_0xcc5d('0x48')][_0xcc5d('0x49')]?_0x4246c3[_0xcc5d('0x48')]:_0x27c0e1[_0xcc5d('0x46')];if(!_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x4a')](_0xcc5d('0x4b'))){_0x4246c3[_0xcc5d('0x2f')]=qs[_0xcc5d('0x2f')](_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x2f')]);_0x4246c3['offset']=qs[_0xcc5d('0x2d')](_0xf8019b['query'][_0xcc5d('0x2d')]);}_0x4246c3['order']=qs[_0xcc5d('0x4c')](_0xf8019b['query']['sort']);_0x4246c3['where']=qs[_0xcc5d('0x44')](_[_0xcc5d('0x4d')](_0xf8019b[_0xcc5d('0x42')],_0x27c0e1[_0xcc5d('0x44')]),_0x121da4);if(_0xf8019b[_0xcc5d('0x42')]['filter']){_0x4246c3[_0xcc5d('0x4e')]=_['merge'](_0x4246c3[_0xcc5d('0x4e')],{'$or':_['map'](_0x121da4,function(_0x2dfaaa){if(_0x2dfaaa[_0xcc5d('0x3f')]!==_0xcc5d('0x4f')){var _0x2472cd={};_0x2472cd[_0x2dfaaa['name']]={'$like':'%'+_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x50')]+'%'};return _0x2472cd;}})});}_0x4246c3=_['merge']({},_0x4246c3,_0xf8019b['options']);var _0x416b23={'where':_0x4246c3[_0xcc5d('0x4e')]};return db[_0xcc5d('0x51')][_0xcc5d('0x30')](_0x416b23)[_0xcc5d('0x1f')](function(_0x5ad436){_0x390983[_0xcc5d('0x30')]=_0x5ad436;if(_0xf8019b[_0xcc5d('0x42')][_0xcc5d('0x52')]){_0x4246c3[_0xcc5d('0x53')]=[{'all':!![]}];}return db[_0xcc5d('0x51')][_0xcc5d('0x54')](_0x4246c3);})[_0xcc5d('0x1f')](function(_0x148cc0){_0x390983[_0xcc5d('0x55')]=_0x148cc0;return _0x390983;})['then'](respondWithFilteredResult(_0x110b0d,_0x4246c3))['catch'](handleError(_0x110b0d,null));};exports[_0xcc5d('0x56')]=function(_0x29a128,_0x41c965){var _0x194c79={'raw':!![],'where':{'id':_0x29a128[_0xcc5d('0x57')]['id']}},_0x5b63ab={};_0x5b63ab['model']=_[_0xcc5d('0x43')](db['ChatQueue'][_0xcc5d('0x3d')]);_0x5b63ab['query']=_[_0xcc5d('0x43')](_0x29a128[_0xcc5d('0x42')]);_0x5b63ab[_0xcc5d('0x44')]=_['intersection'](_0x5b63ab[_0xcc5d('0x46')],_0x5b63ab[_0xcc5d('0x42')]);_0x194c79[_0xcc5d('0x48')]=_['intersection'](_0x5b63ab[_0xcc5d('0x46')],qs[_0xcc5d('0x47')](_0x29a128[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x194c79[_0xcc5d('0x48')]=_0x194c79[_0xcc5d('0x48')][_0xcc5d('0x49')]?_0x194c79[_0xcc5d('0x48')]:_0x5b63ab['model'];if(_0x29a128[_0xcc5d('0x42')][_0xcc5d('0x52')]){_0x194c79[_0xcc5d('0x53')]=[{'all':!![]}];}_0x194c79=_[_0xcc5d('0x58')]({},_0x194c79,_0x29a128[_0xcc5d('0x59')]);return db[_0xcc5d('0x51')][_0xcc5d('0x5a')](_0x194c79)[_0xcc5d('0x1f')](handleEntityNotFound(_0x41c965,null))[_0xcc5d('0x1f')](respondWithResult(_0x41c965,null))[_0xcc5d('0x5b')](handleError(_0x41c965,null));};exports['create']=function(_0x3352fb,_0x15ac6b){return db['ChatQueue'][_0xcc5d('0x5c')](_0x3352fb[_0xcc5d('0x5d')],{})[_0xcc5d('0x1f')](function(_0xf14a12){var _0x26d9a4=_0x3352fb[_0xcc5d('0x5e')][_0xcc5d('0x37')]({'plain':!![]});if(!_0x26d9a4)throw new Error(_0xcc5d('0x5f'));if(_0x26d9a4['role']===_0xcc5d('0x5e')){var _0x41566b=_0xf14a12[_0xcc5d('0x37')]({'plain':!![]});var _0x43fa99=_0xcc5d('0x38');return db[_0xcc5d('0x60')]['find']({'where':{'name':_0x43fa99,'userProfileId':_0x26d9a4['userProfileId']},'raw':!![]})[_0xcc5d('0x1f')](function(_0x53d669){if(_0x53d669&&_0x53d669[_0xcc5d('0x61')]===0x0){return db[_0xcc5d('0x62')]['create']({'name':_0x41566b[_0xcc5d('0x3a')],'resourceId':_0x41566b['id'],'type':_0x53d669[_0xcc5d('0x3a')],'sectionId':_0x53d669['id']},{})[_0xcc5d('0x1f')](function(){return _0xf14a12;});}else{return _0xf14a12;}})['catch'](function(_0x5b87a6){logger['error'](_0xcc5d('0x63'),_0x5b87a6);throw _0x5b87a6;});}return _0xf14a12;})['then'](respondWithResult(_0x15ac6b,0xc9))['catch'](handleError(_0x15ac6b,null));};exports[_0xcc5d('0x35')]=function(_0x1b9bd9,_0x41f224){if(_0x1b9bd9[_0xcc5d('0x5d')]['id']){delete _0x1b9bd9['body']['id'];}return db[_0xcc5d('0x51')][_0xcc5d('0x5a')]({'where':{'id':_0x1b9bd9['params']['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x41f224,null))['then'](saveUpdates(_0x1b9bd9[_0xcc5d('0x5d')],null))['then'](respondWithResult(_0x41f224,null))[_0xcc5d('0x5b')](handleError(_0x41f224,null));};exports['destroy']=function(_0x2b8d55,_0x535253){return db['ChatQueue'][_0xcc5d('0x5a')]({'where':{'id':_0x2b8d55['params']['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x535253,null))[_0xcc5d('0x1f')](removeEntity(_0x535253,null))[_0xcc5d('0x5b')](handleError(_0x535253,null));};exports['describe']=function(_0x44823,_0x2b7d33){return db[_0xcc5d('0x51')][_0xcc5d('0x64')]()[_0xcc5d('0x1f')](respondWithResult(_0x2b7d33,null))[_0xcc5d('0x5b')](handleError(_0x2b7d33,null));};exports[_0xcc5d('0x65')]=function(_0x57efca,_0x1d9dd8,_0x204048){var _0x54cb1c={'raw':!![],'where':{}},_0x3b815c={},_0x4de6d7;return db['ChatQueue'][_0xcc5d('0x66')]({'where':{'id':_0x57efca[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x1d9dd8,null))[_0xcc5d('0x1f')](function(_0x542c55){if(_0x542c55){_0x4de6d7=_0x542c55[_0xcc5d('0x37')]({'plain':!![]});_0x3b815c[_0xcc5d('0x46')]=_['keys'](db[_0xcc5d('0x67')][_0xcc5d('0x3d')]);_0x3b815c['query']=_[_0xcc5d('0x43')](_0x57efca[_0xcc5d('0x42')]);_0x3b815c['filters']=_[_0xcc5d('0x45')](_0x3b815c[_0xcc5d('0x46')],_0x3b815c['query']);_0x54cb1c['attributes']=_[_0xcc5d('0x45')](_0x3b815c[_0xcc5d('0x46')],qs[_0xcc5d('0x47')](_0x57efca[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x54cb1c[_0xcc5d('0x48')]=_0x54cb1c[_0xcc5d('0x48')]['length']?_0x54cb1c[_0xcc5d('0x48')]:_0x3b815c['model'];if(!_0x57efca[_0xcc5d('0x42')][_0xcc5d('0x4a')]('nolimit')){_0x54cb1c['limit']=qs[_0xcc5d('0x2f')](_0x57efca[_0xcc5d('0x42')]['limit']);_0x54cb1c[_0xcc5d('0x2d')]=qs[_0xcc5d('0x2d')](_0x57efca[_0xcc5d('0x42')][_0xcc5d('0x2d')]);}_0x54cb1c[_0xcc5d('0x68')]=qs[_0xcc5d('0x4c')](_0x57efca['query']['sort']);_0x54cb1c[_0xcc5d('0x4e')]=qs['filters'](_[_0xcc5d('0x4d')](_0x57efca[_0xcc5d('0x42')],_0x3b815c[_0xcc5d('0x44')]));_0x54cb1c[_0xcc5d('0x4e')][_0xcc5d('0x69')]=_0x542c55['id'];if(_0x57efca[_0xcc5d('0x42')][_0xcc5d('0x50')]){_0x54cb1c[_0xcc5d('0x4e')]=_[_0xcc5d('0x58')](_0x54cb1c[_0xcc5d('0x4e')],{'$or':_[_0xcc5d('0x41')](_0x54cb1c[_0xcc5d('0x48')],function(_0x522470){var _0x5d93ec={};_0x5d93ec[_0x522470]={'$like':'%'+_0x57efca[_0xcc5d('0x42')]['filter']+'%'};return _0x5d93ec;})});}_0x54cb1c=_[_0xcc5d('0x58')]({},_0x54cb1c,_0x57efca[_0xcc5d('0x59')]);return db['UserChatQueue']['findAll'](_0x54cb1c);}})[_0xcc5d('0x1f')](function(_0x3adf90){if(_0x3adf90){return db[_0xcc5d('0x6a')][_0xcc5d('0x6b')]({'where':{'id':_['map'](_0x3adf90,'UserId'),'role':_0xcc5d('0x6c')},'attributes':['id',_0xcc5d('0x3a'),_0xcc5d('0x6d'),_0xcc5d('0x6e'),_0xcc5d('0x6f')]});}})[_0xcc5d('0x1f')](function(_0x20ffa3){if(_0x20ffa3){return{'count':_0x20ffa3[_0xcc5d('0x30')],'rows':_['map'](_0x20ffa3['rows'],function(_0x4ac3a6){return{'membername':_0x4ac3a6[_0xcc5d('0x3a')],'UserId':_0x4ac3a6['id'],'queue_name':_0x4de6d7['name'],'ChatQueueId':_0x4de6d7['id'],'interface':util['format']('%s/%s',_0xcc5d('0x70'),_0x4ac3a6[_0xcc5d('0x3a')]),'penalty':0x0,'paused':_0x4ac3a6['chatPause'],'createdAt':_0x4ac3a6[_0xcc5d('0x6f')],'updatedAt':_0x4ac3a6[_0xcc5d('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcc5d('0x1f')](respondWithFilteredResult(_0x1d9dd8,_0x54cb1c))['catch'](handleError(_0x1d9dd8,null));};exports[_0xcc5d('0x71')]=function(_0x1c8d9f,_0x340f94,_0x568db0){var _0x15ca04={};var _0x2b064b={};var _0x631a80;var _0x4c99c4;return db[_0xcc5d('0x51')][_0xcc5d('0x66')]({'where':{'id':_0x1c8d9f[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x340f94,null))[_0xcc5d('0x1f')](function(_0x3cd7a8){if(_0x3cd7a8){_0x631a80=_0x3cd7a8;_0x2b064b[_0xcc5d('0x46')]=_[_0xcc5d('0x43')](db[_0xcc5d('0x72')][_0xcc5d('0x3d')]);_0x2b064b[_0xcc5d('0x42')]=_[_0xcc5d('0x43')](_0x1c8d9f[_0xcc5d('0x42')]);_0x2b064b[_0xcc5d('0x44')]=_[_0xcc5d('0x45')](_0x2b064b['model'],_0x2b064b['query']);_0x15ca04['attributes']=_[_0xcc5d('0x45')](_0x2b064b['model'],qs[_0xcc5d('0x47')](_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x15ca04[_0xcc5d('0x48')]=_0x15ca04[_0xcc5d('0x48')][_0xcc5d('0x49')]?_0x15ca04['attributes']:_0x2b064b[_0xcc5d('0x46')];_0x15ca04['order']=qs[_0xcc5d('0x4c')](_0x1c8d9f['query'][_0xcc5d('0x4c')]);_0x15ca04[_0xcc5d('0x4e')]=qs[_0xcc5d('0x44')](_[_0xcc5d('0x4d')](_0x1c8d9f['query'],_0x2b064b['filters']));if(_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x50')]){_0x15ca04[_0xcc5d('0x4e')]=_[_0xcc5d('0x58')](_0x15ca04['where'],{'$or':_[_0xcc5d('0x41')](_0x15ca04['attributes'],function(_0x446412){var _0xbde76e={};_0xbde76e[_0x446412]={'$like':'%'+_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x50')]+'%'};return _0xbde76e;})});}_0x15ca04=_['merge']({},_0x15ca04,_0x1c8d9f['options']);return _0x631a80[_0xcc5d('0x71')](_0x15ca04);}})[_0xcc5d('0x1f')](function(_0x5c54c0){if(_0x5c54c0){_0x4c99c4=_0x5c54c0[_0xcc5d('0x49')];if(!_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x4a')](_0xcc5d('0x4b'))){_0x15ca04['limit']=qs[_0xcc5d('0x2f')](_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x2f')]);_0x15ca04[_0xcc5d('0x2d')]=qs['offset'](_0x1c8d9f[_0xcc5d('0x42')][_0xcc5d('0x2d')]);}return _0x631a80[_0xcc5d('0x71')](_0x15ca04);}})[_0xcc5d('0x1f')](function(_0x1ed9a7){if(_0x1ed9a7){return _0x1ed9a7?{'count':_0x4c99c4,'rows':_0x1ed9a7}:null;}})['then'](respondWithResult(_0x340f94,null))[_0xcc5d('0x5b')](handleError(_0x340f94,null));};exports[_0xcc5d('0x73')]=function(_0x1cb8e5,_0x296944,_0x9f4471){var _0x2ee8dd=_0x1cb8e5[_0xcc5d('0x5d')][_0xcc5d('0x74')];return db[_0xcc5d('0x72')][_0xcc5d('0x54')]({'where':{'id':_0x2ee8dd},'attributes':['id'],'include':[{'model':db[_0xcc5d('0x6a')],'as':_0xcc5d('0x75'),'attributes':['id',_0xcc5d('0x3a'),_0xcc5d('0x76'),'voicePause',_0xcc5d('0x77')],'raw':!![]}]})[_0xcc5d('0x1f')](function(_0x1867ba){if(_0x1867ba){var _0x1ac8ac=_[_0xcc5d('0x78')](_0x1867ba,function(_0x1f428c){var _0x5f2b05=_0x1f428c['get']({'plain':!![]});return _0x5f2b05[_0xcc5d('0x75')];});return db['ChatQueue'][_0xcc5d('0x5a')]({'where':{'id':_0x1cb8e5[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](function(_0x2915c0){return db[_0xcc5d('0x79')][_0xcc5d('0x7a')](function(_0x13e6a1){return _0x2915c0[_0xcc5d('0x73')](_0x2ee8dd,{'transaction':_0x13e6a1})[_0xcc5d('0x1f')](function(){return BPromise[_0xcc5d('0x7b')](_0x1ac8ac,function(_0x51c5f1){return db[_0xcc5d('0x67')][_0xcc5d('0x7c')]({'where':{'UserId':_0x51c5f1['id'],'ChatQueueId':_0x1cb8e5[_0xcc5d('0x57')]['id']},'transaction':_0x13e6a1});});})[_0xcc5d('0x1f')](function(){_0x1ac8ac[_0xcc5d('0x7d')](function(_0x90cb6e){socket[_0xcc5d('0x7e')](_0xcc5d('0x7f'),{'UserId':_0x90cb6e['id'],'ChatQueueId':_0x2915c0['id']});});});});});}})['then'](respondWithStatusCode(_0x296944,null))[_0xcc5d('0x5b')](handleError(_0x296944,null));};exports[_0xcc5d('0x80')]=function(_0x8075a3,_0x4358df,_0x57bb6e){return db['Team'][_0xcc5d('0x54')]({'where':{'id':_0x8075a3[_0xcc5d('0x42')][_0xcc5d('0x74')]},'attributes':['id'],'include':[{'model':db[_0xcc5d('0x6a')],'as':_0xcc5d('0x75'),'attributes':['id'],'raw':!![]}]})[_0xcc5d('0x1f')](handleEntityNotFound(_0x4358df,null))[_0xcc5d('0x1f')](function(_0x200f56){var _0x33a051=_['map'](_0x200f56,'id');var _0x2cb6fc=[];var _0x4ad60e=[];var _0x1567d2=squel['select']();_0x1567d2[_0xcc5d('0x81')](_0xcc5d('0x82'))[_0xcc5d('0x83')](_0xcc5d('0x84'),'tq')[_0xcc5d('0x85')]('user_has_teams','ut',_0xcc5d('0x86'))[_0xcc5d('0x4e')](_0xcc5d('0x87'),_0x8075a3[_0xcc5d('0x57')]['id']);for(var _0x3faf53=0x0;_0x3faf53<_0x200f56['length'];_0x3faf53+=0x1){let _0x4d6ea5=_0x200f56[_0x3faf53];for(var _0x145782=0x0;_0x145782<_0x4d6ea5['Agents'][_0xcc5d('0x49')];_0x145782+=0x1){let _0x545202=_0x4d6ea5[_0xcc5d('0x75')][_0x145782];var _0x313794=_0x1567d2[_0xcc5d('0x88')]();_0x313794[_0xcc5d('0x4e')](_0xcc5d('0x89'),_0x545202['id']);_0x4ad60e[_0xcc5d('0x8a')](db['sequelize'][_0xcc5d('0x42')](_0x313794['toString'](),{'type':db['sequelize'][_0xcc5d('0x8b')]['SELECT']})[_0xcc5d('0x1f')](function(_0xf8404b){if(_0xf8404b[_0xcc5d('0x49')]===0x1){return _0x545202['id'];}else{var _0x384d01=_[_0xcc5d('0x8c')](_[_0xcc5d('0x41')](_0xf8404b,'TeamId'),function(_0x4b60b4){return _[_0xcc5d('0x8d')](_0x33a051,_0x4b60b4);});if(_0x384d01){return _0x545202['id'];}}}));}}return BPromise[_0xcc5d('0x8e')](_0x4ad60e)[_0xcc5d('0x1f')](function(_0x37dc65){_0x2cb6fc=_(_0x2cb6fc)[_0xcc5d('0x8f')](_0x37dc65)['compact']()[_0xcc5d('0x90')]();return db[_0xcc5d('0x51')]['find']({'where':{'id':_0x8075a3[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](function(_0xf1becf){return db['sequelize'][_0xcc5d('0x7a')](function(_0x512e39){return _0xf1becf[_0xcc5d('0x80')](_0x8075a3['query']['ids'],{'transaction':_0x512e39})[_0xcc5d('0x1f')](function(){if(!_[_0xcc5d('0x91')](_0x2cb6fc)){return _0xf1becf[_0xcc5d('0x92')](_0x2cb6fc,{'transaction':_0x512e39});}})[_0xcc5d('0x1f')](function(){_0x2cb6fc[_0xcc5d('0x7d')](function(_0x39a4b1){socket[_0xcc5d('0x7e')](_0xcc5d('0x93'),{'UserId':_0x39a4b1,'ChatQueueId':_0xf1becf['id']});});});});});});})[_0xcc5d('0x1f')](respondWithStatusCode(_0x4358df,null))[_0xcc5d('0x5b')](handleError(_0x4358df,null));};exports['addAgents']=function(_0x470c9b,_0x272def,_0x484f18){return db[_0xcc5d('0x51')][_0xcc5d('0x5a')]({'where':{'id':_0x470c9b[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x272def,null))[_0xcc5d('0x1f')](function(_0x4fa6fe){if(_0x4fa6fe){return _0x4fa6fe[_0xcc5d('0x94')](_0x470c9b[_0xcc5d('0x5d')][_0xcc5d('0x74')],_[_0xcc5d('0x95')](_0x470c9b[_0xcc5d('0x5d')],[_0xcc5d('0x74'),'id'])||{})[_0xcc5d('0x96')](function(_0x583947){for(var _0x5dca26=0x0;_0x5dca26<_0x470c9b[_0xcc5d('0x5d')][_0xcc5d('0x74')][_0xcc5d('0x49')];_0x5dca26+=0x1){socket['emit'](_0xcc5d('0x7f'),{'UserId':Number(_0x470c9b[_0xcc5d('0x5d')][_0xcc5d('0x74')][_0x5dca26]),'ChatQueueId':Number(_0x470c9b[_0xcc5d('0x57')]['id'])});}return _0x583947;});}})[_0xcc5d('0x1f')](respondWithResult(_0x272def,null))[_0xcc5d('0x5b')](handleError(_0x272def,null));};exports[_0xcc5d('0x92')]=function(_0x406c4f,_0x314b6c,_0x18a812){return db[_0xcc5d('0x51')]['find']({'where':{'id':_0x406c4f['params']['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x314b6c,null))[_0xcc5d('0x1f')](function(_0x1e1ab8){if(_0x1e1ab8){return _0x1e1ab8['removeAgents'](_0x406c4f[_0xcc5d('0x42')][_0xcc5d('0x74')])['then'](function(){if(_[_0xcc5d('0x97')](_0x406c4f['query']['ids'])){for(var _0x40ddb7=0x0;_0x40ddb7<_0x406c4f[_0xcc5d('0x42')][_0xcc5d('0x74')][_0xcc5d('0x49')];_0x40ddb7+=0x1){socket[_0xcc5d('0x7e')](_0xcc5d('0x93'),{'UserId':Number(_0x406c4f[_0xcc5d('0x42')]['ids'][_0x40ddb7]),'ChatQueueId':Number(_0x406c4f[_0xcc5d('0x57')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x406c4f[_0xcc5d('0x42')][_0xcc5d('0x74')]),'ChatQueueId':Number(_0x406c4f[_0xcc5d('0x57')]['id'])});}});}})[_0xcc5d('0x1f')](respondWithStatusCode(_0x314b6c,null))['catch'](handleError(_0x314b6c,null));};exports[_0xcc5d('0x98')]=function(_0x41a7bd,_0x4ca663,_0xde427f){var _0x112b9c={};var _0x544eaa={};var _0x236c26;var _0x3df766;return db['ChatQueue'][_0xcc5d('0x66')]({'where':{'id':_0x41a7bd[_0xcc5d('0x57')]['id']}})[_0xcc5d('0x1f')](handleEntityNotFound(_0x4ca663,null))['then'](function(_0x3f2d6f){if(_0x3f2d6f){_0x236c26=_0x3f2d6f;_0x544eaa['model']=_['keys'](db[_0xcc5d('0x6a')][_0xcc5d('0x3d')]);_0x544eaa[_0xcc5d('0x42')]=_[_0xcc5d('0x43')](_0x41a7bd[_0xcc5d('0x42')]);_0x544eaa['filters']=_['intersection'](_0x544eaa[_0xcc5d('0x46')],_0x544eaa[_0xcc5d('0x42')]);_0x112b9c[_0xcc5d('0x48')]=_[_0xcc5d('0x45')](_0x544eaa[_0xcc5d('0x46')],qs[_0xcc5d('0x47')](_0x41a7bd[_0xcc5d('0x42')][_0xcc5d('0x47')]));_0x112b9c[_0xcc5d('0x48')]=_0x112b9c[_0xcc5d('0x48')][_0xcc5d('0x49')]?_0x112b9c[_0xcc5d('0x48')]:_0x544eaa[_0xcc5d('0x46')];_0x112b9c[_0xcc5d('0x68')]=qs[_0xcc5d('0x4c')](_0x41a7bd[_0xcc5d('0x42')]['sort']);_0x112b9c[_0xcc5d('0x4e')]=qs[_0xcc5d('0x44')](_[_0xcc5d('0x4d')](_0x41a7bd['query'],_0x544eaa['filters']));if(_0x41a7bd['query']['filter']){_0x112b9c[_0xcc5d('0x4e')]=_[_0xcc5d('0x58')](_0x112b9c[_0xcc5d('0x4e')],{'$or':_['map'](_0x112b9c[_0xcc5d('0x48')],function(_0x201812){var _0x568bc0={};_0x568bc0[_0x201812]={'$like':'%'+_0x41a7bd['query'][_0xcc5d('0x50')]+'%'};return _0x568bc0;})});}_0x112b9c=_[_0xcc5d('0x58')]({},_0x112b9c,_0x41a7bd[_0xcc5d('0x59')]);return _0x236c26[_0xcc5d('0x98')](_0x112b9c);}})[_0xcc5d('0x1f')](function(_0x57fdf6){if(_0x57fdf6){_0x3df766=_0x57fdf6[_0xcc5d('0x49')];if(!_0x41a7bd[_0xcc5d('0x42')][_0xcc5d('0x4a')](_0xcc5d('0x4b'))){_0x112b9c[_0xcc5d('0x2f')]=qs[_0xcc5d('0x2f')](_0x41a7bd[_0xcc5d('0x42')][_0xcc5d('0x2f')]);_0x112b9c['offset']=qs['offset'](_0x41a7bd['query'][_0xcc5d('0x2d')]);}return _0x236c26[_0xcc5d('0x98')](_0x112b9c);}})[_0xcc5d('0x1f')](function(_0x19a822){if(_0x19a822){return _0x19a822?{'count':_0x3df766,'rows':_0x19a822}:null;}})[_0xcc5d('0x1f')](respondWithResult(_0x4ca663,null))[_0xcc5d('0x5b')](handleError(_0x4ca663,null));};
\ No newline at end of file
+var _0xdcec=['omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','Team','getTeams','nolimit','addTeams','ids','User','voicePause','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','sequelize','removeAgents','userChatQueue:remove'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xdcec,0x1c0));var _0xcdce=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xdcec[_0x221ba2];return _0x47d08e;};'use strict';var emlformat=require(_0xcdce('0x0'));var rimraf=require(_0xcdce('0x1'));var zipdir=require(_0xcdce('0x2'));var jsonpatch=require(_0xcdce('0x3'));var rp=require(_0xcdce('0x4'));var moment=require(_0xcdce('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcdce('0x6'));var path=require(_0xcdce('0x7'));var sox=require('sox');var csv=require(_0xcdce('0x8'));var ejs=require(_0xcdce('0x9'));var fs=require('fs');var fs_extra=require(_0xcdce('0xa'));var _=require(_0xcdce('0xb'));var squel=require('squel');var crypto=require(_0xcdce('0xc'));var jsforce=require(_0xcdce('0xd'));var deskjs=require(_0xcdce('0xe'));var toCsv=require(_0xcdce('0x8'));var querystring=require(_0xcdce('0xf'));var Papa=require(_0xcdce('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcdce('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcdce('0x12'));var utils=require(_0xcdce('0x13'));var config=require(_0xcdce('0x14'));var licenseUtil=require(_0xcdce('0x15'));var db=require(_0xcdce('0x16'))['db'];config['redis']=_[_0xcdce('0x17')](config[_0xcdce('0x18')],{'host':_0xcdce('0x19'),'port':0x18eb});var socket=require(_0xcdce('0x1a'))(new Redis(config['redis']));require(_0xcdce('0x1b'))[_0xcdce('0x1c')](socket);var jayson=require(_0xcdce('0x1d'));var client=jayson[_0xcdce('0x1e')][_0xcdce('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1cefd4,_0x5aae4e,_0x584f83,_0x4bd8fc){return new BPromise(function(_0x507dbe,_0x16075a){var _0x12e549=_0x4bd8fc||client;return _0x12e549[_0xcdce('0x20')](_0x1cefd4,_0x584f83)[_0xcdce('0x21')](function(_0x2e4b73){logger[_0xcdce('0x22')]('ChatQueue,\x20%s,\x20%s',_0x5aae4e,_0xcdce('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5aae4e,_0xcdce('0x23'),JSON['stringify'](_0x2e4b73));if(_0x2e4b73[_0xcdce('0x24')]){if(_0x2e4b73['error'][_0xcdce('0x25')]===0x1f4){logger[_0xcdce('0x24')](_0xcdce('0x26'),_0x5aae4e,_0x2e4b73['error']['message']);return _0x16075a(_0x2e4b73[_0xcdce('0x24')]['message']);}logger['error'](_0xcdce('0x26'),_0x5aae4e,_0x2e4b73[_0xcdce('0x24')][_0xcdce('0x27')]);return _0x507dbe(_0x2e4b73[_0xcdce('0x24')][_0xcdce('0x27')]);}else{logger[_0xcdce('0x22')](_0xcdce('0x26'),_0x5aae4e,_0xcdce('0x23'));_0x507dbe(_0x2e4b73[_0xcdce('0x28')][_0xcdce('0x27')]);}})['catch'](function(_0x1b5740){logger[_0xcdce('0x24')](_0xcdce('0x26'),_0x5aae4e,_0x1b5740);_0x16075a(_0x1b5740);});});}function respondWithStatusCode(_0x253b2a,_0x1d0e08){_0x1d0e08=_0x1d0e08||0xcc;return function(_0x559049){if(_0x559049){return _0x253b2a[_0xcdce('0x29')](_0x1d0e08);}return _0x253b2a[_0xcdce('0x2a')](_0x1d0e08)[_0xcdce('0x2b')]();};}function respondWithResult(_0xed7ad1,_0x35eb6b){_0x35eb6b=_0x35eb6b||0xc8;return function(_0x26bfed){if(_0x26bfed){return _0xed7ad1[_0xcdce('0x2a')](_0x35eb6b)[_0xcdce('0x2c')](_0x26bfed);}};}function respondWithFilteredResult(_0x38ce67,_0x3a1a4a){return function(_0x239512){if(_0x239512){var _0x1f813e=typeof _0x3a1a4a[_0xcdce('0x2d')]==='undefined'&&typeof _0x3a1a4a['limit']===_0xcdce('0x2e');var _0x277700=_0x239512['count'];var _0x56a7d4=_0x1f813e?0x0:_0x3a1a4a[_0xcdce('0x2d')];var _0x3db934=_0x1f813e?_0x239512[_0xcdce('0x2f')]:_0x3a1a4a[_0xcdce('0x2d')]+_0x3a1a4a['limit'];var _0xb93332;if(_0x3db934>=_0x277700){_0x3db934=_0x277700;_0xb93332=0xc8;}else{_0xb93332=0xce;}_0x38ce67[_0xcdce('0x2a')](_0xb93332);return _0x38ce67[_0xcdce('0x30')](_0xcdce('0x31'),_0x56a7d4+'-'+_0x3db934+'/'+_0x277700)[_0xcdce('0x2c')](_0x239512);}return null;};}function patchUpdates(_0x199883){return function(_0x446fe0){try{jsonpatch[_0xcdce('0x32')](_0x446fe0,_0x199883,!![]);}catch(_0x59c946){return BPromise['reject'](_0x59c946);}return _0x446fe0[_0xcdce('0x33')]();};}function saveUpdates(_0x45778b,_0x4eb92e){return function(_0x3d4cf0){if(_0x3d4cf0){return _0x3d4cf0[_0xcdce('0x34')](_0x45778b)['then'](function(_0x334822){return _0x334822;});}return null;};}function removeEntity(_0x370c54,_0x5a5cf0){return function(_0x102792){if(_0x102792){return _0x102792[_0xcdce('0x35')]()['then'](function(){var _0x3a55f5=_0x102792[_0xcdce('0x36')]({'plain':!![]});var _0x272f2b=_0xcdce('0x37');return db[_0xcdce('0x38')][_0xcdce('0x35')]({'where':{'type':_0x272f2b,'resourceId':_0x3a55f5['id']}})[_0xcdce('0x21')](function(){return _0x102792;});})[_0xcdce('0x21')](function(){_0x370c54['status'](0xcc)[_0xcdce('0x2b')]();});}};}function handleEntityNotFound(_0x540fa5,_0x4a74c2){return function(_0xf0d427){if(!_0xf0d427){_0x540fa5[_0xcdce('0x29')](0x194);}return _0xf0d427;};}function handleError(_0x26996,_0x3c9db4){_0x3c9db4=_0x3c9db4||0x1f4;return function(_0x9490c9){logger[_0xcdce('0x24')](_0x9490c9[_0xcdce('0x39')]);if(_0x9490c9[_0xcdce('0x3a')]){delete _0x9490c9[_0xcdce('0x3a')];}_0x26996['status'](_0x3c9db4)['send'](_0x9490c9);};}exports[_0xcdce('0x3b')]=function(_0x34783d,_0x132181){var _0x498cb0={},_0x196c33={},_0x70c391={'count':0x0,'rows':[]};var _0x2dc2af=_[_0xcdce('0x3c')](db[_0xcdce('0x3d')]['rawAttributes'],function(_0x3692d2){return{'name':_0x3692d2[_0xcdce('0x3e')],'type':_0x3692d2[_0xcdce('0x3f')][_0xcdce('0x40')]};});_0x196c33[_0xcdce('0x41')]=_[_0xcdce('0x3c')](_0x2dc2af,_0xcdce('0x3a'));_0x196c33[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x34783d['query']);_0x196c33[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x196c33[_0xcdce('0x41')],_0x196c33[_0xcdce('0x42')]);_0x498cb0[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x196c33['model'],qs[_0xcdce('0x47')](_0x34783d['query']['fields']));_0x498cb0['attributes']=_0x498cb0[_0xcdce('0x46')]['length']?_0x498cb0[_0xcdce('0x46')]:_0x196c33['model'];if(!_0x34783d[_0xcdce('0x42')][_0xcdce('0x48')]('nolimit')){_0x498cb0[_0xcdce('0x49')]=qs['limit'](_0x34783d[_0xcdce('0x42')]['limit']);_0x498cb0['offset']=qs[_0xcdce('0x2d')](_0x34783d['query']['offset']);}_0x498cb0['order']=qs[_0xcdce('0x4a')](_0x34783d[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x498cb0[_0xcdce('0x4b')]=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x34783d[_0xcdce('0x42')],_0x196c33[_0xcdce('0x44')]),_0x2dc2af);if(_0x34783d['query']['filter']){_0x498cb0[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x498cb0[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x2dc2af,function(_0x5dca90){if(_0x5dca90[_0xcdce('0x3f')]!==_0xcdce('0x4e')){var _0xb135de={};_0xb135de[_0x5dca90[_0xcdce('0x3a')]]={'$like':'%'+_0x34783d[_0xcdce('0x42')][_0xcdce('0x4f')]+'%'};return _0xb135de;}})});}_0x498cb0=_[_0xcdce('0x4d')]({},_0x498cb0,_0x34783d[_0xcdce('0x50')]);var _0x3d56ce={'where':_0x498cb0[_0xcdce('0x4b')]};return db[_0xcdce('0x3d')][_0xcdce('0x2f')](_0x3d56ce)[_0xcdce('0x21')](function(_0x10d3ff){_0x70c391[_0xcdce('0x2f')]=_0x10d3ff;if(_0x34783d[_0xcdce('0x42')][_0xcdce('0x51')]){_0x498cb0[_0xcdce('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0xcdce('0x53')](_0x498cb0);})[_0xcdce('0x21')](function(_0x61d3ea){_0x70c391[_0xcdce('0x54')]=_0x61d3ea;return _0x70c391;})[_0xcdce('0x21')](respondWithFilteredResult(_0x132181,_0x498cb0))[_0xcdce('0x55')](handleError(_0x132181,null));};exports[_0xcdce('0x56')]=function(_0x5d1440,_0x1b64d8){var _0x2c197b={'raw':!![],'where':{'id':_0x5d1440[_0xcdce('0x57')]['id']}},_0x22183f={};_0x22183f['model']=_[_0xcdce('0x43')](db[_0xcdce('0x3d')][_0xcdce('0x58')]);_0x22183f[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x5d1440[_0xcdce('0x42')]);_0x22183f[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x22183f[_0xcdce('0x41')],_0x22183f[_0xcdce('0x42')]);_0x2c197b['attributes']=_[_0xcdce('0x45')](_0x22183f[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x5d1440[_0xcdce('0x42')][_0xcdce('0x47')]));_0x2c197b[_0xcdce('0x46')]=_0x2c197b[_0xcdce('0x46')][_0xcdce('0x59')]?_0x2c197b[_0xcdce('0x46')]:_0x22183f['model'];if(_0x5d1440[_0xcdce('0x42')]['includeAll']){_0x2c197b[_0xcdce('0x52')]=[{'all':!![]}];}_0x2c197b=_['merge']({},_0x2c197b,_0x5d1440['options']);return db['ChatQueue']['find'](_0x2c197b)['then'](handleEntityNotFound(_0x1b64d8,null))[_0xcdce('0x21')](respondWithResult(_0x1b64d8,null))[_0xcdce('0x55')](handleError(_0x1b64d8,null));};exports[_0xcdce('0x5a')]=function(_0x121655,_0x137d2f){return db['ChatQueue'][_0xcdce('0x5a')](_0x121655['body'],{})[_0xcdce('0x21')](function(_0x3bb6c7){var _0x24c18c=_0x121655['user'][_0xcdce('0x36')]({'plain':!![]});if(!_0x24c18c)throw new Error(_0xcdce('0x5b'));if(_0x24c18c[_0xcdce('0x5c')]===_0xcdce('0x5d')){var _0x45cfc9=_0x3bb6c7[_0xcdce('0x36')]({'plain':!![]});var _0x535cc7='ChatQueues';return db[_0xcdce('0x5e')][_0xcdce('0x5f')]({'where':{'name':_0x535cc7,'userProfileId':_0x24c18c['userProfileId']},'raw':!![]})[_0xcdce('0x21')](function(_0x1288ff){if(_0x1288ff&&_0x1288ff['autoAssociation']===0x0){return db[_0xcdce('0x38')][_0xcdce('0x5a')]({'name':_0x45cfc9[_0xcdce('0x3a')],'resourceId':_0x45cfc9['id'],'type':_0x1288ff[_0xcdce('0x3a')],'sectionId':_0x1288ff['id']},{})['then'](function(){return _0x3bb6c7;});}else{return _0x3bb6c7;}})[_0xcdce('0x55')](function(_0x1fc1cc){logger['error'](_0xcdce('0x60'),_0x1fc1cc);throw _0x1fc1cc;});}return _0x3bb6c7;})[_0xcdce('0x21')](respondWithResult(_0x137d2f,0xc9))[_0xcdce('0x55')](handleError(_0x137d2f,null));};exports['update']=function(_0x56cb09,_0x53bdd0){if(_0x56cb09[_0xcdce('0x61')]['id']){delete _0x56cb09[_0xcdce('0x61')]['id'];}return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x56cb09[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x53bdd0,null))[_0xcdce('0x21')](saveUpdates(_0x56cb09['body'],null))[_0xcdce('0x21')](respondWithResult(_0x53bdd0,null))[_0xcdce('0x55')](handleError(_0x53bdd0,null));};exports[_0xcdce('0x35')]=function(_0x150f7f,_0x362ed1){return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x150f7f[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x362ed1,null))[_0xcdce('0x21')](removeEntity(_0x362ed1,null))[_0xcdce('0x55')](handleError(_0x362ed1,null));};exports[_0xcdce('0x62')]=function(_0x515bbe,_0x37791c){return db['ChatQueue'][_0xcdce('0x62')]()['then'](respondWithResult(_0x37791c,null))[_0xcdce('0x55')](handleError(_0x37791c,null));};exports[_0xcdce('0x63')]=function(_0x2581b0,_0x54c99e,_0x175677){var _0x1b8f0d={'raw':!![],'where':{}},_0x247418={},_0x598d78;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x2581b0[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x54c99e,null))[_0xcdce('0x21')](function(_0x28ca70){if(_0x28ca70){_0x598d78=_0x28ca70[_0xcdce('0x36')]({'plain':!![]});_0x247418['model']=_[_0xcdce('0x43')](db[_0xcdce('0x65')][_0xcdce('0x58')]);_0x247418[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x2581b0[_0xcdce('0x42')]);_0x247418[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x247418[_0xcdce('0x41')],_0x247418[_0xcdce('0x42')]);_0x1b8f0d[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x247418['model'],qs['fields'](_0x2581b0[_0xcdce('0x42')]['fields']));_0x1b8f0d[_0xcdce('0x46')]=_0x1b8f0d['attributes']['length']?_0x1b8f0d['attributes']:_0x247418[_0xcdce('0x41')];if(!_0x2581b0['query'][_0xcdce('0x48')]('nolimit')){_0x1b8f0d[_0xcdce('0x49')]=qs[_0xcdce('0x49')](_0x2581b0[_0xcdce('0x42')][_0xcdce('0x49')]);_0x1b8f0d[_0xcdce('0x2d')]=qs[_0xcdce('0x2d')](_0x2581b0[_0xcdce('0x42')]['offset']);}_0x1b8f0d[_0xcdce('0x66')]=qs[_0xcdce('0x4a')](_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x1b8f0d[_0xcdce('0x4b')]=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x2581b0[_0xcdce('0x42')],_0x247418[_0xcdce('0x44')]));_0x1b8f0d['where'][_0xcdce('0x67')]=_0x28ca70['id'];if(_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x1b8f0d[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x1b8f0d['where'],{'$or':_[_0xcdce('0x3c')](_0x1b8f0d[_0xcdce('0x46')],function(_0x436999){var _0x4912c1={};_0x4912c1[_0x436999]={'$like':'%'+_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4f')]+'%'};return _0x4912c1;})});}_0x1b8f0d=_[_0xcdce('0x4d')]({},_0x1b8f0d,_0x2581b0['options']);return db[_0xcdce('0x65')]['findAll'](_0x1b8f0d);}})[_0xcdce('0x21')](function(_0x2f2fee){if(_0x2f2fee){return db['User'][_0xcdce('0x68')]({'where':{'id':_[_0xcdce('0x3c')](_0x2f2fee,_0xcdce('0x69')),'role':_0xcdce('0x6a')},'attributes':['id',_0xcdce('0x3a'),'chatPause',_0xcdce('0x6b'),_0xcdce('0x6c')]});}})['then'](function(_0x41645b){if(_0x41645b){return{'count':_0x41645b[_0xcdce('0x2f')],'rows':_[_0xcdce('0x3c')](_0x41645b[_0xcdce('0x54')],function(_0x59c377){return{'membername':_0x59c377['name'],'UserId':_0x59c377['id'],'queue_name':_0x598d78['name'],'ChatQueueId':_0x598d78['id'],'interface':util[_0xcdce('0x6d')](_0xcdce('0x6e'),_0xcdce('0x6f'),_0x59c377[_0xcdce('0x3a')]),'penalty':0x0,'paused':_0x59c377[_0xcdce('0x70')],'createdAt':_0x59c377['createdAt'],'updatedAt':_0x59c377['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xcdce('0x21')](respondWithFilteredResult(_0x54c99e,_0x1b8f0d))[_0xcdce('0x55')](handleError(_0x54c99e,null));};exports['getTeams']=function(_0x69d77c,_0x54e3af,_0x18196b){var _0x5918ad={};var _0x36e207={};var _0x1e8289;var _0x55f2c1;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x69d77c[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x54e3af,null))[_0xcdce('0x21')](function(_0x34d502){if(_0x34d502){_0x1e8289=_0x34d502;_0x36e207[_0xcdce('0x41')]=_[_0xcdce('0x43')](db[_0xcdce('0x71')][_0xcdce('0x58')]);_0x36e207[_0xcdce('0x42')]=_['keys'](_0x69d77c[_0xcdce('0x42')]);_0x36e207[_0xcdce('0x44')]=_['intersection'](_0x36e207['model'],_0x36e207[_0xcdce('0x42')]);_0x5918ad[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x36e207[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x69d77c['query'][_0xcdce('0x47')]));_0x5918ad[_0xcdce('0x46')]=_0x5918ad[_0xcdce('0x46')][_0xcdce('0x59')]?_0x5918ad['attributes']:_0x36e207[_0xcdce('0x41')];_0x5918ad[_0xcdce('0x66')]=qs[_0xcdce('0x4a')](_0x69d77c['query'][_0xcdce('0x4a')]);_0x5918ad[_0xcdce('0x4b')]=qs['filters'](_['pick'](_0x69d77c[_0xcdce('0x42')],_0x36e207[_0xcdce('0x44')]));if(_0x69d77c[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x5918ad[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x5918ad[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x5918ad['attributes'],function(_0x32eda4){var _0x5eb531={};_0x5eb531[_0x32eda4]={'$like':'%'+_0x69d77c[_0xcdce('0x42')]['filter']+'%'};return _0x5eb531;})});}_0x5918ad=_[_0xcdce('0x4d')]({},_0x5918ad,_0x69d77c[_0xcdce('0x50')]);return _0x1e8289[_0xcdce('0x72')](_0x5918ad);}})['then'](function(_0x4403d2){if(_0x4403d2){_0x55f2c1=_0x4403d2['length'];if(!_0x69d77c['query'][_0xcdce('0x48')](_0xcdce('0x73'))){_0x5918ad[_0xcdce('0x49')]=qs[_0xcdce('0x49')](_0x69d77c['query'][_0xcdce('0x49')]);_0x5918ad['offset']=qs[_0xcdce('0x2d')](_0x69d77c['query'][_0xcdce('0x2d')]);}return _0x1e8289[_0xcdce('0x72')](_0x5918ad);}})[_0xcdce('0x21')](function(_0x55386f){if(_0x55386f){return _0x55386f?{'count':_0x55f2c1,'rows':_0x55386f}:null;}})[_0xcdce('0x21')](respondWithResult(_0x54e3af,null))[_0xcdce('0x55')](handleError(_0x54e3af,null));};exports[_0xcdce('0x74')]=function(_0x3e2d5e,_0x1f7558,_0x36ce38){var _0x4e20a2=_0x3e2d5e['body'][_0xcdce('0x75')];return db[_0xcdce('0x71')][_0xcdce('0x53')]({'where':{'id':_0x4e20a2},'attributes':['id'],'include':[{'model':db[_0xcdce('0x76')],'as':'Agents','attributes':['id',_0xcdce('0x3a'),'online',_0xcdce('0x77'),'interface'],'raw':!![]}]})[_0xcdce('0x21')](function(_0x441b14){if(_0x441b14){var _0x4c76b5=_['flatMap'](_0x441b14,function(_0x36c0d0){var _0x39ebc3=_0x36c0d0[_0xcdce('0x36')]({'plain':!![]});return _0x39ebc3[_0xcdce('0x78')];});return db['ChatQueue']['find']({'where':{'id':_0x3e2d5e[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](function(_0x5e17b9){return db['sequelize'][_0xcdce('0x79')](function(_0x269758){return _0x5e17b9[_0xcdce('0x74')](_0x4e20a2,{'transaction':_0x269758})['then'](function(){return BPromise[_0xcdce('0x7a')](_0x4c76b5,function(_0x3f2757){return db['UserChatQueue'][_0xcdce('0x7b')]({'where':{'UserId':_0x3f2757['id'],'ChatQueueId':_0x3e2d5e[_0xcdce('0x57')]['id']},'transaction':_0x269758});});})[_0xcdce('0x21')](function(){_0x4c76b5[_0xcdce('0x7c')](function(_0xbdb99){socket[_0xcdce('0x7d')]('userChatQueue:save',{'UserId':_0xbdb99['id'],'ChatQueueId':_0x5e17b9['id']});});});});});}})[_0xcdce('0x21')](respondWithStatusCode(_0x1f7558,null))[_0xcdce('0x55')](handleError(_0x1f7558,null));};exports[_0xcdce('0x7e')]=function(_0x511497,_0x4a65c5,_0xdd38b5){return db[_0xcdce('0x71')][_0xcdce('0x53')]({'where':{'id':_0x511497[_0xcdce('0x42')][_0xcdce('0x75')]},'attributes':['id'],'include':[{'model':db[_0xcdce('0x76')],'as':_0xcdce('0x78'),'attributes':['id'],'raw':!![]}]})[_0xcdce('0x21')](handleEntityNotFound(_0x4a65c5,null))['then'](function(_0x5624b4){var _0x3c718e=_[_0xcdce('0x3c')](_0x5624b4,'id');var _0x3866ea=[];var _0x394338=[];var _0x4cbda9=squel[_0xcdce('0x7f')]();_0x4cbda9[_0xcdce('0x80')](_0xcdce('0x81'))['from']('team_has_chat_queues','tq')[_0xcdce('0x82')](_0xcdce('0x83'),'ut',_0xcdce('0x84'))[_0xcdce('0x4b')]('ChatQueueId\x20=\x20?',_0x511497['params']['id']);for(var _0x2d32af=0x0;_0x2d32af<_0x5624b4[_0xcdce('0x59')];_0x2d32af+=0x1){let _0x52c447=_0x5624b4[_0x2d32af];for(var _0x32fa7f=0x0;_0x32fa7f<_0x52c447['Agents'][_0xcdce('0x59')];_0x32fa7f+=0x1){let _0x302781=_0x52c447[_0xcdce('0x78')][_0x32fa7f];var _0xcd1477=_0x4cbda9[_0xcdce('0x85')]();_0xcd1477[_0xcdce('0x4b')](_0xcdce('0x86'),_0x302781['id']);_0x394338['push'](db['sequelize'][_0xcdce('0x42')](_0xcd1477[_0xcdce('0x87')](),{'type':db['sequelize']['QueryTypes'][_0xcdce('0x88')]})[_0xcdce('0x21')](function(_0x2c90a8){if(_0x2c90a8[_0xcdce('0x59')]===0x1){return _0x302781['id'];}else{var _0x121d1d=_[_0xcdce('0x89')](_[_0xcdce('0x3c')](_0x2c90a8,'TeamId'),function(_0x27a941){return _[_0xcdce('0x8a')](_0x3c718e,_0x27a941);});if(_0x121d1d){return _0x302781['id'];}}}));}}return BPromise[_0xcdce('0x8b')](_0x394338)['then'](function(_0x487269){_0x3866ea=_(_0x3866ea)[_0xcdce('0x8c')](_0x487269)['compact']()['value']();return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x511497[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](function(_0x38daaf){return db[_0xcdce('0x8d')][_0xcdce('0x79')](function(_0x411733){return _0x38daaf[_0xcdce('0x7e')](_0x511497['query'][_0xcdce('0x75')],{'transaction':_0x411733})[_0xcdce('0x21')](function(){if(!_['isEmpty'](_0x3866ea)){return _0x38daaf[_0xcdce('0x8e')](_0x3866ea,{'transaction':_0x411733});}})[_0xcdce('0x21')](function(){_0x3866ea['forEach'](function(_0x248f8e){socket[_0xcdce('0x7d')](_0xcdce('0x8f'),{'UserId':_0x248f8e,'ChatQueueId':_0x38daaf['id']});});});});});});})[_0xcdce('0x21')](respondWithStatusCode(_0x4a65c5,null))['catch'](handleError(_0x4a65c5,null));};exports['addAgents']=function(_0x1d60e2,_0x5730d0,_0x59119d){return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x1d60e2['params']['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x5730d0,null))[_0xcdce('0x21')](function(_0x2684c7){if(_0x2684c7){return _0x2684c7['addAgents'](_0x1d60e2['body'][_0xcdce('0x75')],_[_0xcdce('0x90')](_0x1d60e2[_0xcdce('0x61')],[_0xcdce('0x75'),'id'])||{})[_0xcdce('0x91')](function(_0x2e89e9){for(var _0x389e4f=0x0;_0x389e4f<_0x1d60e2[_0xcdce('0x61')]['ids']['length'];_0x389e4f+=0x1){socket[_0xcdce('0x7d')](_0xcdce('0x92'),{'UserId':Number(_0x1d60e2[_0xcdce('0x61')][_0xcdce('0x75')][_0x389e4f]),'ChatQueueId':Number(_0x1d60e2[_0xcdce('0x57')]['id'])});}return _0x2e89e9;});}})[_0xcdce('0x21')](respondWithResult(_0x5730d0,null))[_0xcdce('0x55')](handleError(_0x5730d0,null));};exports[_0xcdce('0x8e')]=function(_0x51180a,_0x460d4c,_0x11aa41){return db['ChatQueue'][_0xcdce('0x5f')]({'where':{'id':_0x51180a[_0xcdce('0x57')]['id']}})['then'](handleEntityNotFound(_0x460d4c,null))[_0xcdce('0x21')](function(_0x25d859){if(_0x25d859){return _0x25d859['removeAgents'](_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')])['then'](function(){if(_['isArray'](_0x51180a[_0xcdce('0x42')]['ids'])){for(var _0x31270c=0x0;_0x31270c<_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')][_0xcdce('0x59')];_0x31270c+=0x1){socket[_0xcdce('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')][_0x31270c]),'ChatQueueId':Number(_0x51180a[_0xcdce('0x57')]['id'])});}}else{socket[_0xcdce('0x7d')](_0xcdce('0x8f'),{'UserId':Number(_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')]),'ChatQueueId':Number(_0x51180a['params']['id'])});}});}})[_0xcdce('0x21')](respondWithStatusCode(_0x460d4c,null))[_0xcdce('0x55')](handleError(_0x460d4c,null));};exports[_0xcdce('0x93')]=function(_0x28975d,_0x2cf0b0,_0x36b308){var _0x4d59e4={};var _0x4d98b9={};var _0x29973e;var _0x3cce05;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x28975d[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x2cf0b0,null))['then'](function(_0x491588){if(_0x491588){_0x29973e=_0x491588;_0x4d98b9[_0xcdce('0x41')]=_[_0xcdce('0x43')](db[_0xcdce('0x76')][_0xcdce('0x58')]);_0x4d98b9[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x28975d[_0xcdce('0x42')]);_0x4d98b9['filters']=_['intersection'](_0x4d98b9[_0xcdce('0x41')],_0x4d98b9['query']);_0x4d59e4[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x4d98b9[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x28975d[_0xcdce('0x42')][_0xcdce('0x47')]));_0x4d59e4['attributes']=_0x4d59e4['attributes'][_0xcdce('0x59')]?_0x4d59e4[_0xcdce('0x46')]:_0x4d98b9['model'];_0x4d59e4['order']=qs['sort'](_0x28975d[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x4d59e4['where']=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x28975d[_0xcdce('0x42')],_0x4d98b9[_0xcdce('0x44')]));if(_0x28975d[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x4d59e4[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x4d59e4[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x4d59e4[_0xcdce('0x46')],function(_0x320df1){var _0x5ac920={};_0x5ac920[_0x320df1]={'$like':'%'+_0x28975d[_0xcdce('0x42')]['filter']+'%'};return _0x5ac920;})});}_0x4d59e4=_[_0xcdce('0x4d')]({},_0x4d59e4,_0x28975d[_0xcdce('0x50')]);return _0x29973e['getAgents'](_0x4d59e4);}})['then'](function(_0x559e90){if(_0x559e90){_0x3cce05=_0x559e90[_0xcdce('0x59')];if(!_0x28975d[_0xcdce('0x42')][_0xcdce('0x48')]('nolimit')){_0x4d59e4['limit']=qs['limit'](_0x28975d[_0xcdce('0x42')]['limit']);_0x4d59e4[_0xcdce('0x2d')]=qs[_0xcdce('0x2d')](_0x28975d[_0xcdce('0x42')][_0xcdce('0x2d')]);}return _0x29973e[_0xcdce('0x93')](_0x4d59e4);}})['then'](function(_0x93dc12){if(_0x93dc12){return _0x93dc12?{'count':_0x3cce05,'rows':_0x93dc12}:null;}})[_0xcdce('0x21')](respondWithResult(_0x2cf0b0,null))[_0xcdce('0x55')](handleError(_0x2cf0b0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index dac4abd..a987057 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 _0x5732=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x4da3aa,_0x3cca7a){var _0x24ff0e=function(_0xbf7caf){while(--_0xbf7caf){_0x4da3aa['push'](_0x4da3aa['shift']());}};_0x24ff0e(++_0x3cca7a);}(_0x5732,0xfb));var _0x2573=function(_0x5c66e6,_0x4a4254){_0x5c66e6=_0x5c66e6-0x0;var _0x3b378f=_0x5732[_0x5c66e6];return _0x3b378f;};'use strict';var EventEmitter=require(_0x2573('0x0'));var ChatQueue=require(_0x2573('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2573('0x2'),'afterUpdate':_0x2573('0x3'),'afterDestroy':'remove'};function emitEvent(_0x27696e){return function(_0x2cd27b,_0x2ee042,_0x2d9889){ChatQueueEvents[_0x2573('0x4')](_0x27696e+':'+_0x2cd27b['id'],_0x2cd27b);ChatQueueEvents[_0x2573('0x4')](_0x27696e,_0x2cd27b);_0x2d9889(null);};}for(var e in events){if(events[_0x2573('0x5')](e)){var event=events[e];ChatQueue[_0x2573('0x6')](e,emitEvent(event));}}module[_0x2573('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x6a7a=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x686d95,_0x5e9d91){var _0x1ee747=function(_0x1d1135){while(--_0x1d1135){_0x686d95['push'](_0x686d95['shift']());}};_0x1ee747(++_0x5e9d91);}(_0x6a7a,0x122));var _0xa6a7=function(_0x1fe402,_0xa1d716){_0x1fe402=_0x1fe402-0x0;var _0x11a809=_0x6a7a[_0x1fe402];return _0x11a809;};'use strict';var EventEmitter=require(_0xa6a7('0x0'));var ChatQueue=require(_0xa6a7('0x1'))['db'][_0xa6a7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa6a7('0x3')](0x0);var events={'afterCreate':_0xa6a7('0x4'),'afterUpdate':_0xa6a7('0x5'),'afterDestroy':_0xa6a7('0x6')};function emitEvent(_0x37b38b){return function(_0x20570e,_0x30bf83,_0x2c447e){ChatQueueEvents['emit'](_0x37b38b+':'+_0x20570e['id'],_0x20570e);ChatQueueEvents[_0xa6a7('0x7')](_0x37b38b,_0x20570e);_0x2c447e(null);};}for(var e in events){if(events[_0xa6a7('0x8')](e)){var event=events[e];ChatQueue[_0xa6a7('0x9')](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 7c4eaa3..d20a87b 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 _0xfe5d=['bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0xd88736,_0x9c3494){var _0x24e4a8=function(_0x36607e){while(--_0x36607e){_0xd88736['push'](_0xd88736['shift']());}};_0x24e4a8(++_0x9c3494);}(_0xfe5d,0x80));var _0xdfe5=function(_0x4f5471,_0x40b087){_0x4f5471=_0x4f5471-0x0;var _0x8a9ea0=_0xfe5d[_0x4f5471];return _0x8a9ea0;};'use strict';var _=require(_0xdfe5('0x0'));var util=require(_0xdfe5('0x1'));var logger=require(_0xdfe5('0x2'))('api');var moment=require(_0xdfe5('0x3'));var BPromise=require(_0xdfe5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfe5('0x5'));var rimraf=require(_0xdfe5('0x6'));var config=require(_0xdfe5('0x7'));var attributes=require(_0xdfe5('0x8'));module[_0xdfe5('0x9')]=function(_0x100f26,_0x43e0ad){return _0x100f26[_0xdfe5('0xa')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc821=['define','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x5e88aa,_0x170b60){var _0x55ab65=function(_0xe2531d){while(--_0xe2531d){_0x5e88aa['push'](_0x5e88aa['shift']());}};_0x55ab65(++_0x170b60);}(_0xc821,0x9c));var _0x1c82=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc821[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1c82('0x0'));var logger=require(_0x1c82('0x1'))(_0x1c82('0x2'));var moment=require(_0x1c82('0x3'));var BPromise=require(_0x1c82('0x4'));var rp=require(_0x1c82('0x5'));var fs=require('fs');var path=require(_0x1c82('0x6'));var rimraf=require('rimraf');var config=require(_0x1c82('0x7'));var attributes=require('./chatQueue.attributes');module[_0x1c82('0x8')]=function(_0x52e4cf,_0x32dc7d){return _0x52e4cf[_0x1c82('0x9')]('ChatQueue',attributes,{'tableName':_0x1c82('0xa'),'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 fd2ea7f..76d83a4 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 _0xb749=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','options','raw','where','attributes','limit','include','model','map','then','debug','ShowChatQueue','lodash','moment','bluebird'];(function(_0x283783,_0x31b6b2){var _0x3ca348=function(_0x4cfc67){while(--_0x4cfc67){_0x283783['push'](_0x283783['shift']());}};_0x3ca348(++_0x31b6b2);}(_0xb749,0xac));var _0x9b74=function(_0x1925f8,_0x545551){_0x1925f8=_0x1925f8-0x0;var _0x2fd553=_0xb749[_0x1925f8];return _0x2fd553;};'use strict';var _=require(_0x9b74('0x0'));var util=require('util');var moment=require(_0x9b74('0x1'));var BPromise=require(_0x9b74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b74('0x4'));var logger=require(_0x9b74('0x5'))(_0x9b74('0x6'));var config=require(_0x9b74('0x7'));var jayson=require(_0x9b74('0x8'));var client=jayson[_0x9b74('0x9')]['http']({'port':0x232a});config[_0x9b74('0xa')]=_['defaults'](config[_0x9b74('0xa')],{'host':_0x9b74('0xb'),'port':0x18eb});var socket=require(_0x9b74('0xc'))(new Redis(config[_0x9b74('0xa')]));require(_0x9b74('0xd'))['register'](socket);function respondWithRpcPromise(_0x91a9b4,_0x1fd119,_0x561ca6){return new BPromise(function(_0x3ae044,_0xfc8a79){return client[_0x9b74('0xe')](_0x91a9b4,_0x561ca6)['then'](function(_0x2474a3){logger[_0x9b74('0xf')](_0x9b74('0x10'),_0x1fd119,_0x9b74('0x11'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1fd119,_0x9b74('0x11'),JSON[_0x9b74('0x12')](_0x2474a3));if(_0x2474a3[_0x9b74('0x13')]){if(_0x2474a3[_0x9b74('0x13')]['code']===0x1f4){logger[_0x9b74('0x13')](_0x9b74('0x10'),_0x1fd119,_0x2474a3[_0x9b74('0x13')][_0x9b74('0x14')]);return _0xfc8a79(_0x2474a3[_0x9b74('0x13')][_0x9b74('0x14')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1fd119,_0x2474a3[_0x9b74('0x13')][_0x9b74('0x14')]);return _0x3ae044(_0x2474a3[_0x9b74('0x13')][_0x9b74('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1fd119,_0x9b74('0x11'));_0x3ae044(_0x2474a3[_0x9b74('0x15')]['message']);}})[_0x9b74('0x16')](function(_0x427085){logger[_0x9b74('0x13')]('ChatQueue,\x20%s,\x20%s',_0x1fd119,_0x427085);_0xfc8a79(_0x427085);});});}exports[_0x9b74('0x17')]=function(_0x2a3498){var _0xc94186=this;return new Promise(function(_0x2f2464,_0x4d3673){return db['ChatQueue']['findAll']({'raw':_0x2a3498[_0x9b74('0x18')]?_0x2a3498['options'][_0x9b74('0x19')]===undefined?!![]:![]:!![],'where':_0x2a3498['options']?_0x2a3498[_0x9b74('0x18')][_0x9b74('0x1a')]||null:null,'attributes':_0x2a3498[_0x9b74('0x18')]?_0x2a3498[_0x9b74('0x18')][_0x9b74('0x1b')]||null:null,'limit':_0x2a3498['options']?_0x2a3498[_0x9b74('0x18')][_0x9b74('0x1c')]||null:null,'include':_0x2a3498['options']?_0x2a3498[_0x9b74('0x18')][_0x9b74('0x1d')]?_['map'](_0x2a3498['options'][_0x9b74('0x1d')],function(_0x1d41ca){return{'model':db[_0x1d41ca[_0x9b74('0x1e')]],'as':_0x1d41ca['as'],'attributes':_0x1d41ca[_0x9b74('0x1b')],'include':_0x1d41ca[_0x9b74('0x1d')]?_['map'](_0x1d41ca[_0x9b74('0x1d')],function(_0x35d202){return{'model':db[_0x35d202['model']],'as':_0x35d202['as'],'attributes':_0x35d202[_0x9b74('0x1b')],'include':_0x35d202['include']?_[_0x9b74('0x1f')](_0x35d202['include'],function(_0x55e332){return{'model':db[_0x55e332[_0x9b74('0x1e')]],'as':_0x55e332['as'],'attributes':_0x55e332[_0x9b74('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9b74('0x20')](function(_0x5a0319){logger['info'](_0x9b74('0x17'),_0x2a3498);logger[_0x9b74('0x21')](_0x9b74('0x17'),_0x2a3498,JSON['stringify'](_0x5a0319));_0x2f2464(_0x5a0319);})[_0x9b74('0x16')](function(_0x8f811e){logger[_0x9b74('0x13')](_0x9b74('0x17'),_0x8f811e[_0x9b74('0x14')],_0x2a3498);_0x4d3673(_0xc94186[_0x9b74('0x13')](0x1f4,_0x8f811e[_0x9b74('0x14')]));});});};exports[_0x9b74('0x22')]=function(_0x61e0cb){var _0x2c2a46=this;return new Promise(function(_0x4f7271,_0x54a253){return db['ChatQueue']['find']({'raw':_0x61e0cb[_0x9b74('0x18')]?_0x61e0cb[_0x9b74('0x18')][_0x9b74('0x19')]===undefined?!![]:![]:!![],'where':_0x61e0cb['options']?_0x61e0cb[_0x9b74('0x18')][_0x9b74('0x1a')]||null:null,'attributes':_0x61e0cb['options']?_0x61e0cb['options'][_0x9b74('0x1b')]||null:null,'include':_0x61e0cb[_0x9b74('0x18')]?_0x61e0cb[_0x9b74('0x18')][_0x9b74('0x1d')]?_[_0x9b74('0x1f')](_0x61e0cb['options'][_0x9b74('0x1d')],function(_0x113017){return{'model':db[_0x113017[_0x9b74('0x1e')]],'as':_0x113017['as'],'attributes':_0x113017[_0x9b74('0x1b')],'include':_0x113017['include']?_[_0x9b74('0x1f')](_0x113017[_0x9b74('0x1d')],function(_0x346e2f){return{'model':db[_0x346e2f[_0x9b74('0x1e')]],'as':_0x346e2f['as'],'attributes':_0x346e2f[_0x9b74('0x1b')],'include':_0x346e2f[_0x9b74('0x1d')]?_[_0x9b74('0x1f')](_0x346e2f[_0x9b74('0x1d')],function(_0x32b3e9){return{'model':db[_0x32b3e9[_0x9b74('0x1e')]],'as':_0x32b3e9['as'],'attributes':_0x32b3e9[_0x9b74('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9b74('0x20')](function(_0x2d2b97){logger[_0x9b74('0xf')](_0x9b74('0x22'),_0x61e0cb);logger[_0x9b74('0x21')](_0x9b74('0x22'),_0x61e0cb,JSON[_0x9b74('0x12')](_0x2d2b97));_0x4f7271(_0x2d2b97);})[_0x9b74('0x16')](function(_0x54d9e9){logger[_0x9b74('0x13')]('ShowChatQueue',_0x54d9e9[_0x9b74('0x14')],_0x61e0cb);_0x54a253(_0x2c2a46[_0x9b74('0x13')](0x1f4,_0x54d9e9[_0x9b74('0x14')]));});});};
\ No newline at end of file
+var _0xa169=['error','code','ChatQueue,\x20%s,\x20%s','message','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','model','attributes','include','then','catch','ShowChatQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x398544,_0x161cb3){var _0x46c9c4=function(_0x300fb1){while(--_0x300fb1){_0x398544['push'](_0x398544['shift']());}};_0x46c9c4(++_0x161cb3);}(_0xa169,0xaa));var _0x9a16=function(_0x48feb5,_0x333560){_0x48feb5=_0x48feb5-0x0;var _0x59761d=_0xa169[_0x48feb5];return _0x59761d;};'use strict';var _=require(_0x9a16('0x0'));var util=require(_0x9a16('0x1'));var moment=require(_0x9a16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a16('0x3'));var db=require(_0x9a16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a16('0x5'))(_0x9a16('0x6'));var config=require(_0x9a16('0x7'));var jayson=require(_0x9a16('0x8'));var client=jayson[_0x9a16('0x9')]['http']({'port':0x232a});config[_0x9a16('0xa')]=_[_0x9a16('0xb')](config[_0x9a16('0xa')],{'host':_0x9a16('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a16('0xa')]));require('./chatQueue.socket')[_0x9a16('0xd')](socket);function respondWithRpcPromise(_0x4a0bc6,_0x198eff,_0x41ac32){return new BPromise(function(_0x4f97c7,_0x956e25){return client[_0x9a16('0xe')](_0x4a0bc6,_0x41ac32)['then'](function(_0x5e385a){logger[_0x9a16('0xf')]('ChatQueue,\x20%s,\x20%s',_0x198eff,'request\x20sent');logger[_0x9a16('0x10')](_0x9a16('0x11'),_0x198eff,_0x9a16('0x12'),JSON[_0x9a16('0x13')](_0x5e385a));if(_0x5e385a['error']){if(_0x5e385a[_0x9a16('0x14')][_0x9a16('0x15')]===0x1f4){logger[_0x9a16('0x14')](_0x9a16('0x16'),_0x198eff,_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);return _0x956e25(_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);}logger['error'](_0x9a16('0x16'),_0x198eff,_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);return _0x4f97c7(_0x5e385a[_0x9a16('0x14')]['message']);}else{logger['info'](_0x9a16('0x16'),_0x198eff,_0x9a16('0x12'));_0x4f97c7(_0x5e385a['result'][_0x9a16('0x17')]);}})['catch'](function(_0x5f3f60){logger['error']('ChatQueue,\x20%s,\x20%s',_0x198eff,_0x5f3f60);_0x956e25(_0x5f3f60);});});}exports[_0x9a16('0x18')]=function(_0x3f684f){var _0x4e9732=this;return new Promise(function(_0x1bca76,_0x2d8950){return db[_0x9a16('0x19')][_0x9a16('0x1a')]({'raw':_0x3f684f['options']?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1d')]||null:null,'attributes':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f['options']['attributes']||null:null,'limit':_0x3f684f['options']?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1e')]||null:null,'include':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f[_0x9a16('0x1b')]['include']?_[_0x9a16('0x1f')](_0x3f684f[_0x9a16('0x1b')]['include'],function(_0x42bd3b){return{'model':db[_0x42bd3b[_0x9a16('0x20')]],'as':_0x42bd3b['as'],'attributes':_0x42bd3b[_0x9a16('0x21')],'include':_0x42bd3b[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x42bd3b[_0x9a16('0x22')],function(_0x1ac894){return{'model':db[_0x1ac894['model']],'as':_0x1ac894['as'],'attributes':_0x1ac894[_0x9a16('0x21')],'include':_0x1ac894[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x1ac894[_0x9a16('0x22')],function(_0x20290f){return{'model':db[_0x20290f[_0x9a16('0x20')]],'as':_0x20290f['as'],'attributes':_0x20290f[_0x9a16('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9a16('0x23')](function(_0x241cda){logger['info'](_0x9a16('0x18'),_0x3f684f);logger[_0x9a16('0x10')](_0x9a16('0x18'),_0x3f684f,JSON[_0x9a16('0x13')](_0x241cda));_0x1bca76(_0x241cda);})[_0x9a16('0x24')](function(_0x7be0f5){logger[_0x9a16('0x14')](_0x9a16('0x18'),_0x7be0f5[_0x9a16('0x17')],_0x3f684f);_0x2d8950(_0x4e9732['error'](0x1f4,_0x7be0f5[_0x9a16('0x17')]));});});};exports[_0x9a16('0x25')]=function(_0x16ddc9){var _0x1302fc=this;return new Promise(function(_0x4ea7f5,_0x45f491){return db['ChatQueue']['find']({'raw':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x1c')]===undefined?!![]:![]:!![],'where':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x1d')]||null:null,'attributes':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')]['attributes']||null:null,'include':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')]['include']?_[_0x9a16('0x1f')](_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x22')],function(_0xb8c3a){return{'model':db[_0xb8c3a[_0x9a16('0x20')]],'as':_0xb8c3a['as'],'attributes':_0xb8c3a[_0x9a16('0x21')],'include':_0xb8c3a['include']?_[_0x9a16('0x1f')](_0xb8c3a[_0x9a16('0x22')],function(_0x4a53d3){return{'model':db[_0x4a53d3[_0x9a16('0x20')]],'as':_0x4a53d3['as'],'attributes':_0x4a53d3[_0x9a16('0x21')],'include':_0x4a53d3[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x4a53d3['include'],function(_0x59510f){return{'model':db[_0x59510f[_0x9a16('0x20')]],'as':_0x59510f['as'],'attributes':_0x59510f[_0x9a16('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9a16('0x23')](function(_0x69de2e){logger[_0x9a16('0xf')](_0x9a16('0x25'),_0x16ddc9);logger[_0x9a16('0x10')](_0x9a16('0x25'),_0x16ddc9,JSON[_0x9a16('0x13')](_0x69de2e));_0x4ea7f5(_0x69de2e);})['catch'](function(_0x2a736a){logger[_0x9a16('0x14')](_0x9a16('0x25'),_0x2a736a[_0x9a16('0x17')],_0x16ddc9);_0x45f491(_0x1302fc[_0x9a16('0x14')](0x1f4,_0x2a736a[_0x9a16('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 98832b5..2d8d39f 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 _0x22fb=['remove','emit','removeListener','register','length','chatQueue:'];(function(_0x32febf,_0x4e3901){var _0x246469=function(_0xf83890){while(--_0xf83890){_0x32febf['push'](_0x32febf['shift']());}};_0x246469(++_0x4e3901);}(_0x22fb,0x192));var _0xb22f=function(_0x5da667,_0x3a5e16){_0x5da667=_0x5da667-0x0;var _0x47f4a8=_0x22fb[_0x5da667];return _0x47f4a8;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xb22f('0x0'),'update'];function createListener(_0x3f643d,_0x306b6e){return function(_0x2221f1){_0x306b6e[_0xb22f('0x1')](_0x3f643d,_0x2221f1);};}function removeListener(_0x201512,_0x50cdab){return function(){ChatQueueEvents[_0xb22f('0x2')](_0x201512,_0x50cdab);};}exports[_0xb22f('0x3')]=function(_0x2d1fb3){for(var _0xc3ffcc=0x0,_0x412a95=events[_0xb22f('0x4')];_0xc3ffcc<_0x412a95;_0xc3ffcc++){var _0x47f61a=events[_0xc3ffcc];var _0x34433b=createListener(_0xb22f('0x5')+_0x47f61a,_0x2d1fb3);ChatQueueEvents['on'](_0x47f61a,_0x34433b);}};
\ No newline at end of file
+var _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x2b136c,_0xe706a0){var _0x3f4a87=function(_0x234ffe){while(--_0x234ffe){_0x2b136c['push'](_0x2b136c['shift']());}};_0x3f4a87(++_0xe706a0);}(_0xe107,0xb3));var _0x7e10=function(_0x54d1ce,_0x1b6bc0){_0x54d1ce=_0x54d1ce-0x0;var _0x35896f=_0xe107[_0x54d1ce];return _0x35896f;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index f6129a5..9aae518 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x4802ed,_0xbb726b){var _0xe67dc3=function(_0x20cca6){while(--_0x20cca6){_0x4802ed['push'](_0x4802ed['shift']());}};_0xe67dc3(++_0xbb726b);}(_0xe14b,0x93));var _0xbe14=function(_0x3d9b23,_0x52894d){_0x3d9b23=_0x3d9b23-0x0;var _0xf22517=_0xe14b[_0x3d9b23];return _0xf22517;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x503c5c,_0x38e24d){var _0x894667=function(_0x4f1b17){while(--_0x4f1b17){_0x503c5c['push'](_0x503c5c['shift']());}};_0x894667(++_0x38e24d);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index c59b1eb..bb09fee 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 _0x759a=['STRING','DATE','moment','exports'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x759a,0x126));var _0xa759=function(_0x1d35e9,_0x5ac1b5){_0x1d35e9=_0x1d35e9-0x0;var _0x49c1a4=_0x759a[_0x1d35e9];return _0x49c1a4;};'use strict';var moment=require(_0xa759('0x0'));var Sequelize=require('sequelize');module[_0xa759('0x1')]={'uniqueid':{'type':Sequelize[_0xa759('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa759('0x2')]},'joinAt':{'type':Sequelize[_0xa759('0x3')]},'leaveAt':{'type':Sequelize[_0xa759('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa759('0x3')]},'reason':{'type':Sequelize[_0xa759('0x2')]}};
\ No newline at end of file
+var _0xff58=['DATE','moment','sequelize','exports','STRING'];(function(_0x30af13,_0x243c55){var _0x20bd99=function(_0x5b21a2){while(--_0x5b21a2){_0x30af13['push'](_0x30af13['shift']());}};_0x20bd99(++_0x243c55);}(_0xff58,0x150));var _0x8ff5=function(_0x3e2e99,_0xad339){_0x3e2e99=_0x3e2e99-0x0;var _0x52ceef=_0xff58[_0x3e2e99];return _0x52ceef;};'use strict';var moment=require(_0x8ff5('0x0'));var Sequelize=require(_0x8ff5('0x1'));module[_0x8ff5('0x2')]={'uniqueid':{'type':Sequelize[_0x8ff5('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8ff5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8ff5('0x4')]},'exitAt':{'type':Sequelize[_0x8ff5('0x4')]},'reason':{'type':Sequelize[_0x8ff5('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index fb24404..fc2212f 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 _0xbe2c=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','json','reject','save','update','then','sendStatus','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0x2f77ee,_0x2bff02){var _0x38d29a=function(_0x1f7e81){while(--_0x1f7e81){_0x2f77ee['push'](_0x2f77ee['shift']());}};_0x38d29a(++_0x2bff02);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x195a4e,_0x1b58e){_0x195a4e=_0x195a4e-0x0;var _0x274bbf=_0xbe2c[_0x195a4e];return _0x274bbf;};'use strict';var emlformat=require(_0xcbe2('0x0'));var rimraf=require(_0xcbe2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcbe2('0x2'));var rp=require('request-promise');var moment=require(_0xcbe2('0x3'));var BPromise=require(_0xcbe2('0x4'));var Mustache=require(_0xcbe2('0x5'));var util=require(_0xcbe2('0x6'));var path=require(_0xcbe2('0x7'));var sox=require('sox');var csv=require(_0xcbe2('0x8'));var ejs=require(_0xcbe2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbe2('0xa'));var squel=require(_0xcbe2('0xb'));var crypto=require(_0xcbe2('0xc'));var jsforce=require(_0xcbe2('0xd'));var deskjs=require(_0xcbe2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcbe2('0xf'));var Redis=require(_0xcbe2('0x10'));var authService=require(_0xcbe2('0x11'));var qs=require(_0xcbe2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbe2('0x13'))(_0xcbe2('0x14'));var utils=require(_0xcbe2('0x15'));var config=require(_0xcbe2('0x16'));var licenseUtil=require(_0xcbe2('0x17'));var db=require(_0xcbe2('0x18'))['db'];function respondWithStatusCode(_0x526ce2,_0x1b94fb){_0x1b94fb=_0x1b94fb||0xcc;return function(_0x192c00){if(_0x192c00){return _0x526ce2['sendStatus'](_0x1b94fb);}return _0x526ce2[_0xcbe2('0x19')](_0x1b94fb)['end']();};}function respondWithResult(_0x41de3f,_0x4c18dc){_0x4c18dc=_0x4c18dc||0xc8;return function(_0x3920bf){if(_0x3920bf){return _0x41de3f['status'](_0x4c18dc)['json'](_0x3920bf);}};}function respondWithFilteredResult(_0xb89337,_0x4ec284){return function(_0xb2995b){if(_0xb2995b){var _0x23c38f=typeof _0x4ec284[_0xcbe2('0x1a')]===_0xcbe2('0x1b')&&typeof _0x4ec284[_0xcbe2('0x1c')]===_0xcbe2('0x1b');var _0x126aa9=_0xb2995b['count'];var _0xb968ac=_0x23c38f?0x0:_0x4ec284['offset'];var _0x1c09cb=_0x23c38f?_0xb2995b[_0xcbe2('0x1d')]:_0x4ec284[_0xcbe2('0x1a')]+_0x4ec284[_0xcbe2('0x1c')];var _0x537eb2;if(_0x1c09cb>=_0x126aa9){_0x1c09cb=_0x126aa9;_0x537eb2=0xc8;}else{_0x537eb2=0xce;}_0xb89337[_0xcbe2('0x19')](_0x537eb2);return _0xb89337['set']('Content-Range',_0xb968ac+'-'+_0x1c09cb+'/'+_0x126aa9)[_0xcbe2('0x1e')](_0xb2995b);}return null;};}function patchUpdates(_0x208863){return function(_0x8b1504){try{jsonpatch['apply'](_0x8b1504,_0x208863,!![]);}catch(_0x104706){return BPromise[_0xcbe2('0x1f')](_0x104706);}return _0x8b1504[_0xcbe2('0x20')]();};}function saveUpdates(_0x5167eb,_0x372789){return function(_0x432329){if(_0x432329){return _0x432329[_0xcbe2('0x21')](_0x5167eb)[_0xcbe2('0x22')](function(_0x38048c){return _0x38048c;});}return null;};}function removeEntity(_0x285fc7,_0x2f1e25){return function(_0x2914e6){if(_0x2914e6){return _0x2914e6['destroy']()[_0xcbe2('0x22')](function(){_0x285fc7[_0xcbe2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40039f,_0x1829e6){return function(_0xc6ec9b){if(!_0xc6ec9b){_0x40039f[_0xcbe2('0x23')](0x194);}return _0xc6ec9b;};}function handleError(_0x105b92,_0x4833cd){_0x4833cd=_0x4833cd||0x1f4;return function(_0xbc5aab){logger[_0xcbe2('0x24')](_0xbc5aab['stack']);if(_0xbc5aab[_0xcbe2('0x25')]){delete _0xbc5aab['name'];}_0x105b92[_0xcbe2('0x19')](_0x4833cd)[_0xcbe2('0x26')](_0xbc5aab);};}exports[_0xcbe2('0x27')]=function(_0x431631,_0x4c194d){var _0xdee879={},_0x37eb8b={},_0x4cf95a={'count':0x0,'rows':[]};var _0x3596be=_[_0xcbe2('0x28')](db[_0xcbe2('0x29')][_0xcbe2('0x2a')],function(_0x26d570){return{'name':_0x26d570[_0xcbe2('0x2b')],'type':_0x26d570[_0xcbe2('0x2c')][_0xcbe2('0x2d')]};});_0x37eb8b[_0xcbe2('0x2e')]=_[_0xcbe2('0x28')](_0x3596be,_0xcbe2('0x25'));_0x37eb8b[_0xcbe2('0x2f')]=_[_0xcbe2('0x30')](_0x431631['query']);_0x37eb8b[_0xcbe2('0x31')]=_[_0xcbe2('0x32')](_0x37eb8b['model'],_0x37eb8b['query']);_0xdee879[_0xcbe2('0x33')]=_['intersection'](_0x37eb8b[_0xcbe2('0x2e')],qs[_0xcbe2('0x34')](_0x431631[_0xcbe2('0x2f')][_0xcbe2('0x34')]));_0xdee879[_0xcbe2('0x33')]=_0xdee879[_0xcbe2('0x33')][_0xcbe2('0x35')]?_0xdee879['attributes']:_0x37eb8b[_0xcbe2('0x2e')];if(!_0x431631['query']['hasOwnProperty'](_0xcbe2('0x36'))){_0xdee879['limit']=qs[_0xcbe2('0x1c')](_0x431631['query'][_0xcbe2('0x1c')]);_0xdee879[_0xcbe2('0x1a')]=qs['offset'](_0x431631[_0xcbe2('0x2f')]['offset']);}_0xdee879[_0xcbe2('0x37')]=qs['sort'](_0x431631['query'][_0xcbe2('0x38')]);_0xdee879['where']=qs['filters'](_[_0xcbe2('0x39')](_0x431631['query'],_0x37eb8b[_0xcbe2('0x31')]),_0x3596be);if(_0x431631[_0xcbe2('0x2f')][_0xcbe2('0x3a')]){_0xdee879['where']=_[_0xcbe2('0x3b')](_0xdee879[_0xcbe2('0x3c')],{'$or':_['map'](_0x3596be,function(_0x522bfd){if(_0x522bfd['type']!==_0xcbe2('0x3d')){var _0x4347a7={};_0x4347a7[_0x522bfd[_0xcbe2('0x25')]]={'$like':'%'+_0x431631[_0xcbe2('0x2f')][_0xcbe2('0x3a')]+'%'};return _0x4347a7;}})});}_0xdee879=_['merge']({},_0xdee879,_0x431631[_0xcbe2('0x3e')]);var _0x2b9fd8={'where':_0xdee879['where']};return db[_0xcbe2('0x29')][_0xcbe2('0x1d')](_0x2b9fd8)[_0xcbe2('0x22')](function(_0x3b2878){_0x4cf95a[_0xcbe2('0x1d')]=_0x3b2878;if(_0x431631[_0xcbe2('0x2f')]['includeAll']){_0xdee879[_0xcbe2('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xcbe2('0x40')](_0xdee879);})['then'](function(_0x272fdb){_0x4cf95a['rows']=_0x272fdb;return _0x4cf95a;})[_0xcbe2('0x22')](respondWithFilteredResult(_0x4c194d,_0xdee879))[_0xcbe2('0x41')](handleError(_0x4c194d,null));};exports[_0xcbe2('0x42')]=function(_0x1a200a,_0x4e72bb){var _0x25899c={'raw':!![],'where':{'id':_0x1a200a[_0xcbe2('0x43')]['id']}},_0x5c5684={};_0x5c5684[_0xcbe2('0x2e')]=_[_0xcbe2('0x30')](db['ChatQueueReport'][_0xcbe2('0x2a')]);_0x5c5684[_0xcbe2('0x2f')]=_['keys'](_0x1a200a[_0xcbe2('0x2f')]);_0x5c5684['filters']=_[_0xcbe2('0x32')](_0x5c5684[_0xcbe2('0x2e')],_0x5c5684[_0xcbe2('0x2f')]);_0x25899c[_0xcbe2('0x33')]=_[_0xcbe2('0x32')](_0x5c5684[_0xcbe2('0x2e')],qs['fields'](_0x1a200a['query'][_0xcbe2('0x34')]));_0x25899c['attributes']=_0x25899c[_0xcbe2('0x33')][_0xcbe2('0x35')]?_0x25899c[_0xcbe2('0x33')]:_0x5c5684[_0xcbe2('0x2e')];if(_0x1a200a[_0xcbe2('0x2f')][_0xcbe2('0x44')]){_0x25899c[_0xcbe2('0x3f')]=[{'all':!![]}];}_0x25899c=_[_0xcbe2('0x3b')]({},_0x25899c,_0x1a200a[_0xcbe2('0x3e')]);return db[_0xcbe2('0x29')][_0xcbe2('0x45')](_0x25899c)[_0xcbe2('0x22')](handleEntityNotFound(_0x4e72bb,null))[_0xcbe2('0x22')](respondWithResult(_0x4e72bb,null))[_0xcbe2('0x41')](handleError(_0x4e72bb,null));};exports['create']=function(_0x1110eb,_0x5868be){return db[_0xcbe2('0x29')][_0xcbe2('0x46')](_0x1110eb[_0xcbe2('0x47')],{})['then'](respondWithResult(_0x5868be,0xc9))[_0xcbe2('0x41')](handleError(_0x5868be,null));};exports[_0xcbe2('0x21')]=function(_0x52057b,_0x33e78b){if(_0x52057b[_0xcbe2('0x47')]['id']){delete _0x52057b[_0xcbe2('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x52057b['params']['id']}})[_0xcbe2('0x22')](handleEntityNotFound(_0x33e78b,null))[_0xcbe2('0x22')](saveUpdates(_0x52057b[_0xcbe2('0x47')],null))[_0xcbe2('0x22')](respondWithResult(_0x33e78b,null))[_0xcbe2('0x41')](handleError(_0x33e78b,null));};exports[_0xcbe2('0x48')]=function(_0x2d295c,_0x19f1e1){return db[_0xcbe2('0x29')]['find']({'where':{'id':_0x2d295c['params']['id']}})['then'](handleEntityNotFound(_0x19f1e1,null))[_0xcbe2('0x22')](removeEntity(_0x19f1e1,null))[_0xcbe2('0x41')](handleError(_0x19f1e1,null));};exports[_0xcbe2('0x49')]=function(_0x3b6cf8,_0x3275a5){return db[_0xcbe2('0x29')][_0xcbe2('0x49')]()['then'](respondWithResult(_0x3275a5,null))['catch'](handleError(_0x3275a5,null));};
\ No newline at end of file
+var _0xdc86=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x44dfea,_0x1adca9){var _0x14b889=function(_0x2ff7c9){while(--_0x2ff7c9){_0x44dfea['push'](_0x44dfea['shift']());}};_0x14b889(++_0x1adca9);}(_0xdc86,0x118));var _0x6dc8=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xdc86[_0x11005e];return _0x29338f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6dc8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc8('0x1'));var rp=require('request-promise');var moment=require(_0x6dc8('0x2'));var BPromise=require(_0x6dc8('0x3'));var Mustache=require(_0x6dc8('0x4'));var util=require(_0x6dc8('0x5'));var path=require(_0x6dc8('0x6'));var sox=require('sox');var csv=require(_0x6dc8('0x7'));var ejs=require(_0x6dc8('0x8'));var fs=require('fs');var fs_extra=require(_0x6dc8('0x9'));var _=require(_0x6dc8('0xa'));var squel=require(_0x6dc8('0xb'));var crypto=require(_0x6dc8('0xc'));var jsforce=require(_0x6dc8('0xd'));var deskjs=require(_0x6dc8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6dc8('0xf'));var Papa=require('papaparse');var Redis=require(_0x6dc8('0x10'));var authService=require(_0x6dc8('0x11'));var qs=require(_0x6dc8('0x12'));var as=require(_0x6dc8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6dc8('0x14'))(_0x6dc8('0x15'));var utils=require(_0x6dc8('0x16'));var config=require(_0x6dc8('0x17'));var licenseUtil=require(_0x6dc8('0x18'));var db=require(_0x6dc8('0x19'))['db'];function respondWithStatusCode(_0x49e474,_0x36e427){_0x36e427=_0x36e427||0xcc;return function(_0x542c8b){if(_0x542c8b){return _0x49e474['sendStatus'](_0x36e427);}return _0x49e474[_0x6dc8('0x1a')](_0x36e427)[_0x6dc8('0x1b')]();};}function respondWithResult(_0x21be3d,_0x58c295){_0x58c295=_0x58c295||0xc8;return function(_0x23acc6){if(_0x23acc6){return _0x21be3d[_0x6dc8('0x1a')](_0x58c295)[_0x6dc8('0x1c')](_0x23acc6);}};}function respondWithFilteredResult(_0x45a2f7,_0x28158d){return function(_0x4782c8){if(_0x4782c8){var _0x351c11=typeof _0x28158d[_0x6dc8('0x1d')]===_0x6dc8('0x1e')&&typeof _0x28158d['limit']==='undefined';var _0x2702c5=_0x4782c8[_0x6dc8('0x1f')];var _0x209ae4=_0x351c11?0x0:_0x28158d[_0x6dc8('0x1d')];var _0x2f3b94=_0x351c11?_0x4782c8['count']:_0x28158d['offset']+_0x28158d['limit'];var _0x2247c4;if(_0x2f3b94>=_0x2702c5){_0x2f3b94=_0x2702c5;_0x2247c4=0xc8;}else{_0x2247c4=0xce;}_0x45a2f7['status'](_0x2247c4);return _0x45a2f7[_0x6dc8('0x20')]('Content-Range',_0x209ae4+'-'+_0x2f3b94+'/'+_0x2702c5)[_0x6dc8('0x1c')](_0x4782c8);}return null;};}function patchUpdates(_0x4467a1){return function(_0x3e161a){try{jsonpatch[_0x6dc8('0x21')](_0x3e161a,_0x4467a1,!![]);}catch(_0x1949be){return BPromise[_0x6dc8('0x22')](_0x1949be);}return _0x3e161a[_0x6dc8('0x23')]();};}function saveUpdates(_0x38ce80,_0x1436d1){return function(_0x5526cd){if(_0x5526cd){return _0x5526cd[_0x6dc8('0x24')](_0x38ce80)[_0x6dc8('0x25')](function(_0x30afb5){return _0x30afb5;});}return null;};}function removeEntity(_0x49b5a8,_0xf69b){return function(_0x5c78db){if(_0x5c78db){return _0x5c78db[_0x6dc8('0x26')]()[_0x6dc8('0x25')](function(){_0x49b5a8[_0x6dc8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56895f,_0x1983f8){return function(_0x14ec58){if(!_0x14ec58){_0x56895f['sendStatus'](0x194);}return _0x14ec58;};}function handleError(_0x4596db,_0x4636be){_0x4636be=_0x4636be||0x1f4;return function(_0x36b904){logger['error'](_0x36b904['stack']);if(_0x36b904[_0x6dc8('0x27')]){delete _0x36b904[_0x6dc8('0x27')];}_0x4596db['status'](_0x4636be)[_0x6dc8('0x28')](_0x36b904);};}exports['index']=function(_0x482cc6,_0x4e9f46){var _0x63da34={},_0x283a42={},_0x35e1fc={'count':0x0,'rows':[]};var _0x1fde66=_[_0x6dc8('0x29')](db[_0x6dc8('0x2a')][_0x6dc8('0x2b')],function(_0x437671){return{'name':_0x437671[_0x6dc8('0x2c')],'type':_0x437671[_0x6dc8('0x2d')]['key']};});_0x283a42[_0x6dc8('0x2e')]=_['map'](_0x1fde66,'name');_0x283a42[_0x6dc8('0x2f')]=_[_0x6dc8('0x30')](_0x482cc6[_0x6dc8('0x2f')]);_0x283a42[_0x6dc8('0x31')]=_['intersection'](_0x283a42[_0x6dc8('0x2e')],_0x283a42['query']);_0x63da34[_0x6dc8('0x32')]=_['intersection'](_0x283a42[_0x6dc8('0x2e')],qs[_0x6dc8('0x33')](_0x482cc6['query'][_0x6dc8('0x33')]));_0x63da34[_0x6dc8('0x32')]=_0x63da34['attributes'][_0x6dc8('0x34')]?_0x63da34[_0x6dc8('0x32')]:_0x283a42[_0x6dc8('0x2e')];if(!_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x35')]('nolimit')){_0x63da34['limit']=qs[_0x6dc8('0x36')](_0x482cc6['query'][_0x6dc8('0x36')]);_0x63da34[_0x6dc8('0x1d')]=qs['offset'](_0x482cc6['query'][_0x6dc8('0x1d')]);}_0x63da34['order']=qs[_0x6dc8('0x37')](_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x37')]);_0x63da34[_0x6dc8('0x38')]=qs[_0x6dc8('0x31')](_[_0x6dc8('0x39')](_0x482cc6[_0x6dc8('0x2f')],_0x283a42['filters']),_0x1fde66);if(_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3a')]){_0x63da34[_0x6dc8('0x38')]=_[_0x6dc8('0x3b')](_0x63da34[_0x6dc8('0x38')],{'$or':_[_0x6dc8('0x29')](_0x1fde66,function(_0x14822f){if(_0x14822f[_0x6dc8('0x2d')]!==_0x6dc8('0x3c')){var _0x5b5e67={};_0x5b5e67[_0x14822f['name']]={'$like':'%'+_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3a')]+'%'};return _0x5b5e67;}})});}_0x63da34=_['merge']({},_0x63da34,_0x482cc6[_0x6dc8('0x3d')]);var _0x2f4078={'where':_0x63da34[_0x6dc8('0x38')]};return db[_0x6dc8('0x2a')][_0x6dc8('0x1f')](_0x2f4078)[_0x6dc8('0x25')](function(_0x400070){_0x35e1fc[_0x6dc8('0x1f')]=_0x400070;if(_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3e')]){_0x63da34[_0x6dc8('0x3f')]=[{'all':!![]}];}return db[_0x6dc8('0x2a')][_0x6dc8('0x40')](_0x63da34);})[_0x6dc8('0x25')](function(_0xc46154){_0x35e1fc[_0x6dc8('0x41')]=_0xc46154;return _0x35e1fc;})[_0x6dc8('0x25')](respondWithFilteredResult(_0x4e9f46,_0x63da34))[_0x6dc8('0x42')](handleError(_0x4e9f46,null));};exports['show']=function(_0x483868,_0x1b5d94){var _0x34d6ca={'raw':!![],'where':{'id':_0x483868[_0x6dc8('0x43')]['id']}},_0x2de273={};_0x2de273[_0x6dc8('0x2e')]=_[_0x6dc8('0x30')](db[_0x6dc8('0x2a')][_0x6dc8('0x2b')]);_0x2de273[_0x6dc8('0x2f')]=_['keys'](_0x483868[_0x6dc8('0x2f')]);_0x2de273[_0x6dc8('0x31')]=_[_0x6dc8('0x44')](_0x2de273[_0x6dc8('0x2e')],_0x2de273[_0x6dc8('0x2f')]);_0x34d6ca['attributes']=_[_0x6dc8('0x44')](_0x2de273['model'],qs[_0x6dc8('0x33')](_0x483868['query']['fields']));_0x34d6ca['attributes']=_0x34d6ca['attributes'][_0x6dc8('0x34')]?_0x34d6ca[_0x6dc8('0x32')]:_0x2de273[_0x6dc8('0x2e')];if(_0x483868[_0x6dc8('0x2f')][_0x6dc8('0x3e')]){_0x34d6ca[_0x6dc8('0x3f')]=[{'all':!![]}];}_0x34d6ca=_[_0x6dc8('0x3b')]({},_0x34d6ca,_0x483868[_0x6dc8('0x3d')]);return db[_0x6dc8('0x2a')][_0x6dc8('0x45')](_0x34d6ca)['then'](handleEntityNotFound(_0x1b5d94,null))['then'](respondWithResult(_0x1b5d94,null))[_0x6dc8('0x42')](handleError(_0x1b5d94,null));};exports[_0x6dc8('0x46')]=function(_0x151b05,_0x2b516a){return db[_0x6dc8('0x2a')][_0x6dc8('0x46')](_0x151b05[_0x6dc8('0x47')],{})[_0x6dc8('0x25')](respondWithResult(_0x2b516a,0xc9))[_0x6dc8('0x42')](handleError(_0x2b516a,null));};exports['update']=function(_0x8fe06e,_0x387f48){if(_0x8fe06e[_0x6dc8('0x47')]['id']){delete _0x8fe06e[_0x6dc8('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x8fe06e[_0x6dc8('0x43')]['id']}})['then'](handleEntityNotFound(_0x387f48,null))[_0x6dc8('0x25')](saveUpdates(_0x8fe06e[_0x6dc8('0x47')],null))['then'](respondWithResult(_0x387f48,null))['catch'](handleError(_0x387f48,null));};exports['destroy']=function(_0x3707f8,_0x6e3f57){return db[_0x6dc8('0x2a')]['find']({'where':{'id':_0x3707f8[_0x6dc8('0x43')]['id']}})[_0x6dc8('0x25')](handleEntityNotFound(_0x6e3f57,null))[_0x6dc8('0x25')](removeEntity(_0x6e3f57,null))[_0x6dc8('0x42')](handleError(_0x6e3f57,null));};exports[_0x6dc8('0x48')]=function(_0x2db363,_0x5e9e5d){return db[_0x6dc8('0x2a')][_0x6dc8('0x48')]()['then'](respondWithResult(_0x5e9e5d,null))[_0x6dc8('0x42')](handleError(_0x5e9e5d,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 7039d83..e7331d2 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x3d7c5b,_0x296fed){var _0x9c1421=function(_0x5477ce){while(--_0x5477ce){_0x3d7c5b['push'](_0x3d7c5b['shift']());}};_0x9c1421(++_0x296fed);}(_0x757a,0xde));var _0xa757=function(_0x3219fd,_0x1121a2){_0x3219fd=_0x3219fd-0x0;var _0x2b500e=_0x757a[_0x3219fd];return _0x2b500e;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x32db19,_0x145d3a){var _0x130d3f=function(_0xdf8f97){while(--_0xdf8f97){_0x32db19['push'](_0x32db19['shift']());}};_0x130d3f(++_0x145d3a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb7e7[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index e7fb549..aa1ca24 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 _0x0b66=['jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','ChatQueueReport,\x20%s,\x20%s','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','stringify','catch','UpdateChatQueueReport','update','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x37a738,_0x302f32){var _0x58a23a=function(_0x500ed0){while(--_0x500ed0){_0x37a738['push'](_0x37a738['shift']());}};_0x58a23a(++_0x302f32);}(_0x0b66,0x1b9));var _0x60b6=function(_0x362c80,_0x1b8621){_0x362c80=_0x362c80-0x0;var _0xcc5206=_0x0b66[_0x362c80];return _0xcc5206;};'use strict';var _=require('lodash');var util=require(_0x60b6('0x0'));var moment=require(_0x60b6('0x1'));var BPromise=require('bluebird');var rs=require(_0x60b6('0x2'));var fs=require('fs');var Redis=require(_0x60b6('0x3'));var db=require(_0x60b6('0x4'))['db'];var utils=require(_0x60b6('0x5'));var logger=require(_0x60b6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x60b6('0x7'));var client=jayson[_0x60b6('0x8')][_0x60b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15fc3d,_0x4bdeca,_0x1f0265){return new BPromise(function(_0xac7161,_0x9e15ac){return client[_0x60b6('0xa')](_0x15fc3d,_0x1f0265)['then'](function(_0x100d80){logger[_0x60b6('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x4bdeca,_0x60b6('0xc'));logger[_0x60b6('0xd')](_0x60b6('0xe'),_0x4bdeca,_0x60b6('0xc'),JSON['stringify'](_0x100d80));if(_0x100d80['error']){if(_0x100d80['error']['code']===0x1f4){logger[_0x60b6('0xf')](_0x60b6('0x10'),_0x4bdeca,_0x100d80['error'][_0x60b6('0x11')]);return _0x9e15ac(_0x100d80['error'][_0x60b6('0x11')]);}logger['error'](_0x60b6('0x10'),_0x4bdeca,_0x100d80[_0x60b6('0xf')]['message']);return _0xac7161(_0x100d80['error']['message']);}else{logger[_0x60b6('0xb')](_0x60b6('0x10'),_0x4bdeca,'request\x20sent');_0xac7161(_0x100d80['result']['message']);}})['catch'](function(_0x1dd9de){logger[_0x60b6('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x4bdeca,_0x1dd9de);_0x9e15ac(_0x1dd9de);});});}exports[_0x60b6('0x12')]=function(_0x58c747){var _0x51418e=this;return new Promise(function(_0x391aea,_0x14ea69){return db[_0x60b6('0x13')][_0x60b6('0x14')](_0x58c747[_0x60b6('0x15')],{'raw':_0x58c747['options']?_0x58c747[_0x60b6('0x16')][_0x60b6('0x17')]===undefined?!![]:![]:!![]})[_0x60b6('0x18')](function(_0x572de3){logger['info'](_0x60b6('0x12'),_0x58c747);logger['debug'](_0x60b6('0x12'),_0x58c747,JSON[_0x60b6('0x19')](_0x572de3));_0x391aea(_0x572de3);})[_0x60b6('0x1a')](function(_0x5d6424){logger[_0x60b6('0xf')](_0x60b6('0x12'),_0x5d6424[_0x60b6('0x11')],_0x58c747);_0x14ea69(_0x51418e[_0x60b6('0xf')](0x1f4,_0x5d6424[_0x60b6('0x11')]));});});};exports[_0x60b6('0x1b')]=function(_0x25e544){var _0x469fe0=this;return new Promise(function(_0x24104f,_0x38aa5b){return db[_0x60b6('0x13')][_0x60b6('0x1c')](_0x25e544['body'],{'raw':_0x25e544[_0x60b6('0x16')]?_0x25e544[_0x60b6('0x16')][_0x60b6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25e544[_0x60b6('0x16')]?_0x25e544[_0x60b6('0x16')][_0x60b6('0x1d')]||null:null,'attributes':_0x25e544[_0x60b6('0x16')]?_0x25e544[_0x60b6('0x16')][_0x60b6('0x1e')]||null:null,'limit':_0x25e544['options']?_0x25e544[_0x60b6('0x16')][_0x60b6('0x1f')]||null:null})[_0x60b6('0x18')](function(_0x53cd4f){logger[_0x60b6('0xb')](_0x60b6('0x1b'),_0x25e544);logger['debug'](_0x60b6('0x1b'),_0x25e544,JSON[_0x60b6('0x19')](_0x53cd4f));_0x24104f(_0x53cd4f);})[_0x60b6('0x1a')](function(_0x3e79c2){logger['error']('UpdateChatQueueReport',_0x3e79c2[_0x60b6('0x11')],_0x25e544);_0x38aa5b(_0x469fe0['error'](0x1f4,_0x3e79c2[_0x60b6('0x11')]));});});};
\ No newline at end of file
+var _0xd398=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','ChatQueueReport','body','options','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','raw','where','limit','lodash','util','moment'];(function(_0xa4d0d9,_0x36a590){var _0x2cb66a=function(_0x16153e){while(--_0x16153e){_0xa4d0d9['push'](_0xa4d0d9['shift']());}};_0x2cb66a(++_0x36a590);}(_0xd398,0x1dd));var _0x8d39=function(_0x2aed6b,_0x14ddb2){_0x2aed6b=_0x2aed6b-0x0;var _0x3a703d=_0xd398[_0x2aed6b];return _0x3a703d;};'use strict';var _=require(_0x8d39('0x0'));var util=require(_0x8d39('0x1'));var moment=require(_0x8d39('0x2'));var BPromise=require(_0x8d39('0x3'));var rs=require(_0x8d39('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d39('0x5'))['db'];var utils=require(_0x8d39('0x6'));var logger=require(_0x8d39('0x7'))(_0x8d39('0x8'));var config=require(_0x8d39('0x9'));var jayson=require(_0x8d39('0xa'));var client=jayson[_0x8d39('0xb')][_0x8d39('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38dd94,_0x1d8081,_0x41fe53){return new BPromise(function(_0x3405f3,_0x4711c7){return client['request'](_0x38dd94,_0x41fe53)[_0x8d39('0xd')](function(_0x3392e3){logger[_0x8d39('0xe')](_0x8d39('0xf'),_0x1d8081,'request\x20sent');logger[_0x8d39('0x10')](_0x8d39('0x11'),_0x1d8081,_0x8d39('0x12'),JSON['stringify'](_0x3392e3));if(_0x3392e3[_0x8d39('0x13')]){if(_0x3392e3[_0x8d39('0x13')]['code']===0x1f4){logger['error'](_0x8d39('0xf'),_0x1d8081,_0x3392e3[_0x8d39('0x13')][_0x8d39('0x14')]);return _0x4711c7(_0x3392e3[_0x8d39('0x13')]['message']);}logger['error'](_0x8d39('0xf'),_0x1d8081,_0x3392e3[_0x8d39('0x13')][_0x8d39('0x14')]);return _0x3405f3(_0x3392e3[_0x8d39('0x13')]['message']);}else{logger[_0x8d39('0xe')](_0x8d39('0xf'),_0x1d8081,'request\x20sent');_0x3405f3(_0x3392e3['result'][_0x8d39('0x14')]);}})[_0x8d39('0x15')](function(_0x182980){logger[_0x8d39('0x13')](_0x8d39('0xf'),_0x1d8081,_0x182980);_0x4711c7(_0x182980);});});}exports['CreateChatQueueReport']=function(_0x1eabfa){var _0x295ae5=this;return new Promise(function(_0x1e5f95,_0x531e41){return db[_0x8d39('0x16')]['create'](_0x1eabfa[_0x8d39('0x17')],{'raw':_0x1eabfa[_0x8d39('0x18')]?_0x1eabfa[_0x8d39('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18e30d){logger[_0x8d39('0xe')](_0x8d39('0x19'),_0x1eabfa);logger['debug']('CreateChatQueueReport',_0x1eabfa,JSON[_0x8d39('0x1a')](_0x18e30d));_0x1e5f95(_0x18e30d);})[_0x8d39('0x15')](function(_0x48d0e2){logger['error']('CreateChatQueueReport',_0x48d0e2[_0x8d39('0x14')],_0x1eabfa);_0x531e41(_0x295ae5[_0x8d39('0x13')](0x1f4,_0x48d0e2[_0x8d39('0x14')]));});});};exports[_0x8d39('0x1b')]=function(_0x57e88d){var _0x2f4f85=this;return new Promise(function(_0x488451,_0x59e406){return db[_0x8d39('0x16')][_0x8d39('0x1c')](_0x57e88d[_0x8d39('0x17')],{'raw':_0x57e88d[_0x8d39('0x18')]?_0x57e88d['options'][_0x8d39('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57e88d[_0x8d39('0x18')]?_0x57e88d[_0x8d39('0x18')][_0x8d39('0x1e')]||null:null,'attributes':_0x57e88d[_0x8d39('0x18')]?_0x57e88d[_0x8d39('0x18')]['attributes']||null:null,'limit':_0x57e88d['options']?_0x57e88d[_0x8d39('0x18')][_0x8d39('0x1f')]||null:null})[_0x8d39('0xd')](function(_0x1120b6){logger[_0x8d39('0xe')](_0x8d39('0x1b'),_0x57e88d);logger[_0x8d39('0x10')](_0x8d39('0x1b'),_0x57e88d,JSON[_0x8d39('0x1a')](_0x1120b6));_0x488451(_0x1120b6);})[_0x8d39('0x15')](function(_0x57865a){logger[_0x8d39('0x13')]('UpdateChatQueueReport',_0x57865a[_0x8d39('0x14')],_0x57e88d);_0x59e406(_0x2f4f85[_0x8d39('0x13')](0x1f4,_0x57865a[_0x8d39('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index d14a5c6..5cc0c9c 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 _0x99e7=['destroy','multer','util','connect-timeout','Router','../../components/interaction/service','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x99e7,0x19f));var _0x799e=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0x99e7[_0x24cc72];return _0xd49f1e;};'use strict';var multer=require(_0x799e('0x0'));var util=require(_0x799e('0x1'));var path=require('path');var timeout=require(_0x799e('0x2'));var express=require('express');var router=express[_0x799e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x799e('0x4'));var config=require('../../config/environment');var controller=require(_0x799e('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x799e('0x6')]);router[_0x799e('0x7')](_0x799e('0x8'),auth[_0x799e('0x9')](),controller[_0x799e('0xa')]);router['get'](_0x799e('0xb'),auth['isAuthenticated'](),controller[_0x799e('0xc')]);router[_0x799e('0xd')]('/',auth[_0x799e('0x9')](),controller[_0x799e('0xe')]);router[_0x799e('0xf')](_0x799e('0xb'),auth[_0x799e('0x9')](),controller[_0x799e('0x10')]);router['delete'](_0x799e('0xb'),auth[_0x799e('0x9')](),controller[_0x799e('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x5ade=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','/describe','describe','get','post','put'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x5ade,0x116));var _0xe5ad=function(_0x4d1002,_0x1575ac){_0x4d1002=_0x4d1002-0x0;var _0x441aba=_0x5ade[_0x4d1002];return _0x441aba;};'use strict';var multer=require(_0xe5ad('0x0'));var util=require(_0xe5ad('0x1'));var path=require(_0xe5ad('0x2'));var timeout=require(_0xe5ad('0x3'));var express=require('express');var router=express[_0xe5ad('0x4')]();var fs_extra=require(_0xe5ad('0x5'));var auth=require(_0xe5ad('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5ad('0x7'));var controller=require(_0xe5ad('0x8'));router['get']('/',auth[_0xe5ad('0x9')](),controller[_0xe5ad('0xa')]);router['get'](_0xe5ad('0xb'),auth[_0xe5ad('0x9')](),controller[_0xe5ad('0xc')]);router[_0xe5ad('0xd')]('/:id',auth[_0xe5ad('0x9')](),controller['show']);router[_0xe5ad('0xe')]('/',auth[_0xe5ad('0x9')](),controller['create']);router[_0xe5ad('0xf')](_0xe5ad('0x10'),auth['isAuthenticated'](),controller[_0xe5ad('0x11')]);router[_0xe5ad('0x12')](_0xe5ad('0x10'),auth[_0xe5ad('0x9')](),controller[_0xe5ad('0x13')]);module[_0xe5ad('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 be372c5..199e04e 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5ddfd6,_0x32ddcd){var _0x5a7ba9=function(_0x476c78){while(--_0x476c78){_0x5ddfd6['push'](_0x5ddfd6['shift']());}};_0x5a7ba9(++_0x32ddcd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x00bb[_0x55e08b];return _0xd1a7ff;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x276c27,_0x5e56dd){var _0x56fbe4=function(_0x3ea975){while(--_0x3ea975){_0x276c27['push'](_0x276c27['shift']());}};_0x56fbe4(++_0x5e56dd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x00bb[_0x55e08b];return _0xd1a7ff;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 5f49691..34a6d06 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 _0xb70e=['VIRTUAL','options','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','map','ChatTransferReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type'];(function(_0x684bee,_0xbf2e7){var _0x524c9f=function(_0x18b127){while(--_0x18b127){_0x684bee['push'](_0x684bee['shift']());}};_0x524c9f(++_0xbf2e7);}(_0xb70e,0x1ee));var _0xeb70=function(_0xbd28e,_0x250eb3){_0xbd28e=_0xbd28e-0x0;var _0x1155e0=_0xb70e[_0xbd28e];return _0x1155e0;};'use strict';var emlformat=require(_0xeb70('0x0'));var rimraf=require(_0xeb70('0x1'));var zipdir=require(_0xeb70('0x2'));var jsonpatch=require(_0xeb70('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb70('0x4'));var util=require('util');var path=require('path');var sox=require(_0xeb70('0x5'));var csv=require(_0xeb70('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb70('0x7'));var _=require(_0xeb70('0x8'));var squel=require(_0xeb70('0x9'));var crypto=require(_0xeb70('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xeb70('0xb'));var toCsv=require(_0xeb70('0x6'));var querystring=require(_0xeb70('0xc'));var Papa=require(_0xeb70('0xd'));var Redis=require('ioredis');var authService=require(_0xeb70('0xe'));var qs=require(_0xeb70('0xf'));var as=require(_0xeb70('0x10'));var hardwareService=require(_0xeb70('0x11'));var logger=require(_0xeb70('0x12'))(_0xeb70('0x13'));var utils=require(_0xeb70('0x14'));var config=require(_0xeb70('0x15'));var licenseUtil=require(_0xeb70('0x16'));var db=require(_0xeb70('0x17'))['db'];function respondWithStatusCode(_0x3eb8ae,_0x4b9e47){_0x4b9e47=_0x4b9e47||0xcc;return function(_0x5d5ae1){if(_0x5d5ae1){return _0x3eb8ae[_0xeb70('0x18')](_0x4b9e47);}return _0x3eb8ae[_0xeb70('0x19')](_0x4b9e47)['end']();};}function respondWithResult(_0x441660,_0x281388){_0x281388=_0x281388||0xc8;return function(_0xa4bf6a){if(_0xa4bf6a){return _0x441660[_0xeb70('0x19')](_0x281388)[_0xeb70('0x1a')](_0xa4bf6a);}};}function respondWithFilteredResult(_0x12e262,_0x58c304){return function(_0xcd3d48){if(_0xcd3d48){var _0xad4bba=typeof _0x58c304[_0xeb70('0x1b')]===_0xeb70('0x1c')&&typeof _0x58c304[_0xeb70('0x1d')]===_0xeb70('0x1c');var _0x1d525b=_0xcd3d48[_0xeb70('0x1e')];var _0x102ac6=_0xad4bba?0x0:_0x58c304['offset'];var _0x37c934=_0xad4bba?_0xcd3d48[_0xeb70('0x1e')]:_0x58c304[_0xeb70('0x1b')]+_0x58c304['limit'];var _0x2577ac;if(_0x37c934>=_0x1d525b){_0x37c934=_0x1d525b;_0x2577ac=0xc8;}else{_0x2577ac=0xce;}_0x12e262[_0xeb70('0x19')](_0x2577ac);return _0x12e262[_0xeb70('0x1f')](_0xeb70('0x20'),_0x102ac6+'-'+_0x37c934+'/'+_0x1d525b)[_0xeb70('0x1a')](_0xcd3d48);}return null;};}function patchUpdates(_0x68c67f){return function(_0x213252){try{jsonpatch[_0xeb70('0x21')](_0x213252,_0x68c67f,!![]);}catch(_0x327a6a){return BPromise['reject'](_0x327a6a);}return _0x213252['save']();};}function saveUpdates(_0x296b49,_0x14119a){return function(_0x286b57){if(_0x286b57){return _0x286b57[_0xeb70('0x22')](_0x296b49)[_0xeb70('0x23')](function(_0x890e1f){return _0x890e1f;});}return null;};}function removeEntity(_0x40743f,_0x1a4f0c){return function(_0x3deb1f){if(_0x3deb1f){return _0x3deb1f['destroy']()[_0xeb70('0x23')](function(){_0x40743f[_0xeb70('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34a9a0,_0x2c81ab){return function(_0x158196){if(!_0x158196){_0x34a9a0['sendStatus'](0x194);}return _0x158196;};}function handleError(_0x4c69b4,_0x2813a0){_0x2813a0=_0x2813a0||0x1f4;return function(_0x538d43){logger[_0xeb70('0x24')](_0x538d43[_0xeb70('0x25')]);if(_0x538d43[_0xeb70('0x26')]){delete _0x538d43[_0xeb70('0x26')];}_0x4c69b4[_0xeb70('0x19')](_0x2813a0)[_0xeb70('0x27')](_0x538d43);};}exports['index']=function(_0x3eab93,_0x24c07b){var _0x5edf6e={},_0x307aa7={},_0x22ae05={'count':0x0,'rows':[]};var _0x3abe83=_[_0xeb70('0x28')](db[_0xeb70('0x29')][_0xeb70('0x2a')],function(_0xa88baa){return{'name':_0xa88baa['fieldName'],'type':_0xa88baa['type']['key']};});_0x307aa7['model']=_[_0xeb70('0x28')](_0x3abe83,_0xeb70('0x26'));_0x307aa7[_0xeb70('0x2b')]=_[_0xeb70('0x2c')](_0x3eab93[_0xeb70('0x2b')]);_0x307aa7[_0xeb70('0x2d')]=_[_0xeb70('0x2e')](_0x307aa7[_0xeb70('0x2f')],_0x307aa7[_0xeb70('0x2b')]);_0x5edf6e[_0xeb70('0x30')]=_[_0xeb70('0x2e')](_0x307aa7['model'],qs['fields'](_0x3eab93[_0xeb70('0x2b')][_0xeb70('0x31')]));_0x5edf6e[_0xeb70('0x30')]=_0x5edf6e[_0xeb70('0x30')][_0xeb70('0x32')]?_0x5edf6e[_0xeb70('0x30')]:_0x307aa7[_0xeb70('0x2f')];if(!_0x3eab93['query']['hasOwnProperty'](_0xeb70('0x33'))){_0x5edf6e[_0xeb70('0x1d')]=qs[_0xeb70('0x1d')](_0x3eab93[_0xeb70('0x2b')]['limit']);_0x5edf6e[_0xeb70('0x1b')]=qs[_0xeb70('0x1b')](_0x3eab93[_0xeb70('0x2b')]['offset']);}_0x5edf6e['order']=qs[_0xeb70('0x34')](_0x3eab93[_0xeb70('0x2b')][_0xeb70('0x34')]);_0x5edf6e[_0xeb70('0x35')]=qs[_0xeb70('0x2d')](_[_0xeb70('0x36')](_0x3eab93[_0xeb70('0x2b')],_0x307aa7['filters']),_0x3abe83);if(_0x3eab93[_0xeb70('0x2b')][_0xeb70('0x37')]){_0x5edf6e[_0xeb70('0x35')]=_[_0xeb70('0x38')](_0x5edf6e[_0xeb70('0x35')],{'$or':_[_0xeb70('0x28')](_0x3abe83,function(_0x72c856){if(_0x72c856[_0xeb70('0x39')]!==_0xeb70('0x3a')){var _0x23657a={};_0x23657a[_0x72c856[_0xeb70('0x26')]]={'$like':'%'+_0x3eab93[_0xeb70('0x2b')][_0xeb70('0x37')]+'%'};return _0x23657a;}})});}_0x5edf6e=_[_0xeb70('0x38')]({},_0x5edf6e,_0x3eab93[_0xeb70('0x3b')]);var _0x1c318e={'where':_0x5edf6e[_0xeb70('0x35')]};return db[_0xeb70('0x29')][_0xeb70('0x1e')](_0x1c318e)[_0xeb70('0x23')](function(_0x157992){_0x22ae05[_0xeb70('0x1e')]=_0x157992;if(_0x3eab93[_0xeb70('0x2b')]['includeAll']){_0x5edf6e[_0xeb70('0x3c')]=[{'all':!![]}];}return db[_0xeb70('0x29')]['findAll'](_0x5edf6e);})['then'](function(_0xf6a928){_0x22ae05[_0xeb70('0x3d')]=_0xf6a928;return _0x22ae05;})[_0xeb70('0x23')](respondWithFilteredResult(_0x24c07b,_0x5edf6e))[_0xeb70('0x3e')](handleError(_0x24c07b,null));};exports[_0xeb70('0x3f')]=function(_0x559cb0,_0x596ac2){var _0x4094b0={'raw':!![],'where':{'id':_0x559cb0[_0xeb70('0x40')]['id']}},_0x15de9b={};_0x15de9b[_0xeb70('0x2f')]=_[_0xeb70('0x2c')](db[_0xeb70('0x29')]['rawAttributes']);_0x15de9b[_0xeb70('0x2b')]=_[_0xeb70('0x2c')](_0x559cb0[_0xeb70('0x2b')]);_0x15de9b[_0xeb70('0x2d')]=_['intersection'](_0x15de9b[_0xeb70('0x2f')],_0x15de9b[_0xeb70('0x2b')]);_0x4094b0[_0xeb70('0x30')]=_[_0xeb70('0x2e')](_0x15de9b[_0xeb70('0x2f')],qs[_0xeb70('0x31')](_0x559cb0[_0xeb70('0x2b')]['fields']));_0x4094b0[_0xeb70('0x30')]=_0x4094b0['attributes'][_0xeb70('0x32')]?_0x4094b0[_0xeb70('0x30')]:_0x15de9b[_0xeb70('0x2f')];if(_0x559cb0[_0xeb70('0x2b')]['includeAll']){_0x4094b0[_0xeb70('0x3c')]=[{'all':!![]}];}_0x4094b0=_[_0xeb70('0x38')]({},_0x4094b0,_0x559cb0[_0xeb70('0x3b')]);return db[_0xeb70('0x29')][_0xeb70('0x41')](_0x4094b0)['then'](handleEntityNotFound(_0x596ac2,null))[_0xeb70('0x23')](respondWithResult(_0x596ac2,null))[_0xeb70('0x3e')](handleError(_0x596ac2,null));};exports[_0xeb70('0x42')]=function(_0x158500,_0x23283a){return db[_0xeb70('0x29')][_0xeb70('0x42')](_0x158500[_0xeb70('0x43')],{})[_0xeb70('0x23')](respondWithResult(_0x23283a,0xc9))['catch'](handleError(_0x23283a,null));};exports[_0xeb70('0x22')]=function(_0x418a26,_0x2c7b4e){if(_0x418a26[_0xeb70('0x43')]['id']){delete _0x418a26[_0xeb70('0x43')]['id'];}return db['ChatTransferReport'][_0xeb70('0x41')]({'where':{'id':_0x418a26[_0xeb70('0x40')]['id']}})[_0xeb70('0x23')](handleEntityNotFound(_0x2c7b4e,null))[_0xeb70('0x23')](saveUpdates(_0x418a26[_0xeb70('0x43')],null))['then'](respondWithResult(_0x2c7b4e,null))[_0xeb70('0x3e')](handleError(_0x2c7b4e,null));};exports['destroy']=function(_0xa8b10f,_0x4fa856){return db['ChatTransferReport'][_0xeb70('0x41')]({'where':{'id':_0xa8b10f[_0xeb70('0x40')]['id']}})['then'](handleEntityNotFound(_0x4fa856,null))['then'](removeEntity(_0x4fa856,null))['catch'](handleError(_0x4fa856,null));};exports[_0xeb70('0x44')]=function(_0x3d7554,_0x4949b5){return db[_0xeb70('0x29')][_0xeb70('0x44')]()[_0xeb70('0x23')](respondWithResult(_0x4949b5,null))[_0xeb70('0x3e')](handleError(_0x4949b5,null));};
\ No newline at end of file
+var _0x7a8f=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','include','find','create','body','destroy','describe','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','end','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x7a8f,0x1ed));var _0xf7a8=function(_0xe3d180,_0x1a2a7f){_0xe3d180=_0xe3d180-0x0;var _0x440869=_0x7a8f[_0xe3d180];return _0x440869;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a8('0x1'));var rp=require('request-promise');var moment=require(_0xf7a8('0x2'));var BPromise=require(_0xf7a8('0x3'));var Mustache=require(_0xf7a8('0x4'));var util=require('util');var path=require(_0xf7a8('0x5'));var sox=require(_0xf7a8('0x6'));var csv=require(_0xf7a8('0x7'));var ejs=require(_0xf7a8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a8('0x9'));var squel=require(_0xf7a8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf7a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf7a8('0xc'));var Papa=require(_0xf7a8('0xd'));var Redis=require(_0xf7a8('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7a8('0xf'));var logger=require('../../config/logger')(_0xf7a8('0x10'));var utils=require(_0xf7a8('0x11'));var config=require(_0xf7a8('0x12'));var licenseUtil=require(_0xf7a8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28bec7,_0x3e970a){_0x3e970a=_0x3e970a||0xcc;return function(_0x5b0af9){if(_0x5b0af9){return _0x28bec7['sendStatus'](_0x3e970a);}return _0x28bec7[_0xf7a8('0x14')](_0x3e970a)['end']();};}function respondWithResult(_0x5c13e7,_0x43a604){_0x43a604=_0x43a604||0xc8;return function(_0x4a60d2){if(_0x4a60d2){return _0x5c13e7['status'](_0x43a604)['json'](_0x4a60d2);}};}function respondWithFilteredResult(_0x3b6769,_0x11a9b7){return function(_0x7655a3){if(_0x7655a3){var _0x339fdf=typeof _0x11a9b7['offset']===_0xf7a8('0x15')&&typeof _0x11a9b7[_0xf7a8('0x16')]===_0xf7a8('0x15');var _0x5457d2=_0x7655a3[_0xf7a8('0x17')];var _0x197b6f=_0x339fdf?0x0:_0x11a9b7['offset'];var _0x568db1=_0x339fdf?_0x7655a3['count']:_0x11a9b7[_0xf7a8('0x18')]+_0x11a9b7['limit'];var _0xc5b680;if(_0x568db1>=_0x5457d2){_0x568db1=_0x5457d2;_0xc5b680=0xc8;}else{_0xc5b680=0xce;}_0x3b6769[_0xf7a8('0x14')](_0xc5b680);return _0x3b6769[_0xf7a8('0x19')](_0xf7a8('0x1a'),_0x197b6f+'-'+_0x568db1+'/'+_0x5457d2)['json'](_0x7655a3);}return null;};}function patchUpdates(_0x4216db){return function(_0x1e8cdc){try{jsonpatch[_0xf7a8('0x1b')](_0x1e8cdc,_0x4216db,!![]);}catch(_0x37961a){return BPromise['reject'](_0x37961a);}return _0x1e8cdc[_0xf7a8('0x1c')]();};}function saveUpdates(_0x3d2f98,_0xccae90){return function(_0x186469){if(_0x186469){return _0x186469[_0xf7a8('0x1d')](_0x3d2f98)[_0xf7a8('0x1e')](function(_0x49ed45){return _0x49ed45;});}return null;};}function removeEntity(_0x32ab43,_0x332060){return function(_0x4976e9){if(_0x4976e9){return _0x4976e9['destroy']()[_0xf7a8('0x1e')](function(){_0x32ab43[_0xf7a8('0x14')](0xcc)[_0xf7a8('0x1f')]();});}};}function handleEntityNotFound(_0x203c8d,_0x21d53e){return function(_0x55c905){if(!_0x55c905){_0x203c8d[_0xf7a8('0x20')](0x194);}return _0x55c905;};}function handleError(_0xad5e79,_0x3337ed){_0x3337ed=_0x3337ed||0x1f4;return function(_0x1350ad){logger['error'](_0x1350ad[_0xf7a8('0x21')]);if(_0x1350ad[_0xf7a8('0x22')]){delete _0x1350ad[_0xf7a8('0x22')];}_0xad5e79[_0xf7a8('0x14')](_0x3337ed)[_0xf7a8('0x23')](_0x1350ad);};}exports[_0xf7a8('0x24')]=function(_0x29d995,_0x558779){var _0x222931={},_0x4d224d={},_0x57b6b7={'count':0x0,'rows':[]};var _0x3f43fa=_[_0xf7a8('0x25')](db[_0xf7a8('0x26')][_0xf7a8('0x27')],function(_0x18673c){return{'name':_0x18673c['fieldName'],'type':_0x18673c[_0xf7a8('0x28')][_0xf7a8('0x29')]};});_0x4d224d[_0xf7a8('0x2a')]=_['map'](_0x3f43fa,_0xf7a8('0x22'));_0x4d224d[_0xf7a8('0x2b')]=_[_0xf7a8('0x2c')](_0x29d995['query']);_0x4d224d[_0xf7a8('0x2d')]=_[_0xf7a8('0x2e')](_0x4d224d[_0xf7a8('0x2a')],_0x4d224d[_0xf7a8('0x2b')]);_0x222931[_0xf7a8('0x2f')]=_[_0xf7a8('0x2e')](_0x4d224d[_0xf7a8('0x2a')],qs[_0xf7a8('0x30')](_0x29d995['query'][_0xf7a8('0x30')]));_0x222931[_0xf7a8('0x2f')]=_0x222931[_0xf7a8('0x2f')][_0xf7a8('0x31')]?_0x222931[_0xf7a8('0x2f')]:_0x4d224d['model'];if(!_0x29d995['query'][_0xf7a8('0x32')]('nolimit')){_0x222931['limit']=qs[_0xf7a8('0x16')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x16')]);_0x222931[_0xf7a8('0x18')]=qs[_0xf7a8('0x18')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x18')]);}_0x222931[_0xf7a8('0x33')]=qs[_0xf7a8('0x34')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x34')]);_0x222931[_0xf7a8('0x35')]=qs[_0xf7a8('0x2d')](_[_0xf7a8('0x36')](_0x29d995[_0xf7a8('0x2b')],_0x4d224d[_0xf7a8('0x2d')]),_0x3f43fa);if(_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x37')]){_0x222931['where']=_[_0xf7a8('0x38')](_0x222931[_0xf7a8('0x35')],{'$or':_[_0xf7a8('0x25')](_0x3f43fa,function(_0x26c466){if(_0x26c466[_0xf7a8('0x28')]!==_0xf7a8('0x39')){var _0x28520c={};_0x28520c[_0x26c466[_0xf7a8('0x22')]]={'$like':'%'+_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x37')]+'%'};return _0x28520c;}})});}_0x222931=_[_0xf7a8('0x38')]({},_0x222931,_0x29d995[_0xf7a8('0x3a')]);var _0x50eb7c={'where':_0x222931[_0xf7a8('0x35')]};return db[_0xf7a8('0x26')][_0xf7a8('0x17')](_0x50eb7c)[_0xf7a8('0x1e')](function(_0x40073c){_0x57b6b7['count']=_0x40073c;if(_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x3b')]){_0x222931['include']=[{'all':!![]}];}return db[_0xf7a8('0x26')]['findAll'](_0x222931);})['then'](function(_0x3bde50){_0x57b6b7['rows']=_0x3bde50;return _0x57b6b7;})[_0xf7a8('0x1e')](respondWithFilteredResult(_0x558779,_0x222931))[_0xf7a8('0x3c')](handleError(_0x558779,null));};exports['show']=function(_0x1ed415,_0x344520){var _0x2a24e2={'raw':!![],'where':{'id':_0x1ed415[_0xf7a8('0x3d')]['id']}},_0x3c9da8={};_0x3c9da8[_0xf7a8('0x2a')]=_[_0xf7a8('0x2c')](db['ChatTransferReport']['rawAttributes']);_0x3c9da8['query']=_[_0xf7a8('0x2c')](_0x1ed415[_0xf7a8('0x2b')]);_0x3c9da8['filters']=_[_0xf7a8('0x2e')](_0x3c9da8[_0xf7a8('0x2a')],_0x3c9da8[_0xf7a8('0x2b')]);_0x2a24e2[_0xf7a8('0x2f')]=_[_0xf7a8('0x2e')](_0x3c9da8['model'],qs['fields'](_0x1ed415[_0xf7a8('0x2b')][_0xf7a8('0x30')]));_0x2a24e2[_0xf7a8('0x2f')]=_0x2a24e2[_0xf7a8('0x2f')][_0xf7a8('0x31')]?_0x2a24e2[_0xf7a8('0x2f')]:_0x3c9da8[_0xf7a8('0x2a')];if(_0x1ed415[_0xf7a8('0x2b')]['includeAll']){_0x2a24e2[_0xf7a8('0x3e')]=[{'all':!![]}];}_0x2a24e2=_[_0xf7a8('0x38')]({},_0x2a24e2,_0x1ed415[_0xf7a8('0x3a')]);return db[_0xf7a8('0x26')][_0xf7a8('0x3f')](_0x2a24e2)[_0xf7a8('0x1e')](handleEntityNotFound(_0x344520,null))[_0xf7a8('0x1e')](respondWithResult(_0x344520,null))['catch'](handleError(_0x344520,null));};exports[_0xf7a8('0x40')]=function(_0x4554aa,_0x401e65){return db['ChatTransferReport']['create'](_0x4554aa[_0xf7a8('0x41')],{})[_0xf7a8('0x1e')](respondWithResult(_0x401e65,0xc9))['catch'](handleError(_0x401e65,null));};exports[_0xf7a8('0x1d')]=function(_0x3063fb,_0xf9b5ee){if(_0x3063fb[_0xf7a8('0x41')]['id']){delete _0x3063fb[_0xf7a8('0x41')]['id'];}return db[_0xf7a8('0x26')][_0xf7a8('0x3f')]({'where':{'id':_0x3063fb[_0xf7a8('0x3d')]['id']}})[_0xf7a8('0x1e')](handleEntityNotFound(_0xf9b5ee,null))[_0xf7a8('0x1e')](saveUpdates(_0x3063fb['body'],null))['then'](respondWithResult(_0xf9b5ee,null))['catch'](handleError(_0xf9b5ee,null));};exports[_0xf7a8('0x42')]=function(_0xec247,_0x5d59b0){return db['ChatTransferReport'][_0xf7a8('0x3f')]({'where':{'id':_0xec247[_0xf7a8('0x3d')]['id']}})[_0xf7a8('0x1e')](handleEntityNotFound(_0x5d59b0,null))[_0xf7a8('0x1e')](removeEntity(_0x5d59b0,null))[_0xf7a8('0x3c')](handleError(_0x5d59b0,null));};exports['describe']=function(_0x55b380,_0x33f4cb){return db[_0xf7a8('0x26')][_0xf7a8('0x43')]()[_0xf7a8('0x1e')](respondWithResult(_0x33f4cb,null))[_0xf7a8('0x3c')](handleError(_0x33f4cb,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 84de1fb..8044a8b 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 _0x934a=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','define'];(function(_0x541fdf,_0x268606){var _0x3f11cf=function(_0x103d78){while(--_0x103d78){_0x541fdf['push'](_0x541fdf['shift']());}};_0x3f11cf(++_0x268606);}(_0x934a,0xfe));var _0xa934=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x934a[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xa934('0x0'));var util=require(_0xa934('0x1'));var logger=require(_0xa934('0x2'))(_0xa934('0x3'));var moment=require('moment');var BPromise=require(_0xa934('0x4'));var rp=require(_0xa934('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa934('0x6'));var config=require(_0xa934('0x7'));var attributes=require(_0xa934('0x8'));module['exports']=function(_0x17157b,_0x8cab85){return _0x17157b[_0xa934('0x9')]('ChatTransferReport',attributes,{'tableName':_0xa934('0xa'),'paranoid':![],'indexes':[{'name':_0xa934('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f73=['util','../../config/logger','moment','bluebird','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash'];(function(_0x7eb7d6,_0x52900e){var _0x1cabf5=function(_0x4a59d9){while(--_0x4a59d9){_0x7eb7d6['push'](_0x7eb7d6['shift']());}};_0x1cabf5(++_0x52900e);}(_0x0f73,0x117));var _0x30f7=function(_0x4145da,_0x1dcf93){_0x4145da=_0x4145da-0x0;var _0x2dd421=_0x0f73[_0x4145da];return _0x2dd421;};'use strict';var _=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var logger=require(_0x30f7('0x2'))('api');var moment=require(_0x30f7('0x3'));var BPromise=require(_0x30f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x30f7('0x5'));var config=require('../../config/environment');var attributes=require(_0x30f7('0x6'));module[_0x30f7('0x7')]=function(_0x1b8159,_0x43107f){return _0x1b8159['define'](_0x30f7('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x30f7('0x9'),'fields':[_0x30f7('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 941f722..60833dc 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 _0xc4ce=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0xc4ce,0x1e4));var _0xec4c=function(_0x31add5,_0x2879bb){_0x31add5=_0x31add5-0x0;var _0x23b83c=_0xc4ce[_0x31add5];return _0x23b83c;};'use strict';var _=require(_0xec4c('0x0'));var util=require(_0xec4c('0x1'));var moment=require(_0xec4c('0x2'));var BPromise=require('bluebird');var rs=require(_0xec4c('0x3'));var fs=require('fs');var Redis=require(_0xec4c('0x4'));var db=require(_0xec4c('0x5'))['db'];var utils=require(_0xec4c('0x6'));var logger=require('../../config/logger')(_0xec4c('0x7'));var config=require(_0xec4c('0x8'));var jayson=require(_0xec4c('0x9'));var client=jayson[_0xec4c('0xa')][_0xec4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x598148,_0x5e64a7,_0x58c6a3){return new BPromise(function(_0x3787c2,_0xd47b81){return client[_0xec4c('0xc')](_0x598148,_0x58c6a3)['then'](function(_0x3c9b92){logger['info'](_0xec4c('0xd'),_0x5e64a7,_0xec4c('0xe'));logger[_0xec4c('0xf')](_0xec4c('0x10'),_0x5e64a7,_0xec4c('0xe'),JSON[_0xec4c('0x11')](_0x3c9b92));if(_0x3c9b92[_0xec4c('0x12')]){if(_0x3c9b92[_0xec4c('0x12')][_0xec4c('0x13')]===0x1f4){logger[_0xec4c('0x12')](_0xec4c('0xd'),_0x5e64a7,_0x3c9b92['error'][_0xec4c('0x14')]);return _0xd47b81(_0x3c9b92[_0xec4c('0x12')][_0xec4c('0x14')]);}logger[_0xec4c('0x12')](_0xec4c('0xd'),_0x5e64a7,_0x3c9b92[_0xec4c('0x12')][_0xec4c('0x14')]);return _0x3787c2(_0x3c9b92[_0xec4c('0x12')][_0xec4c('0x14')]);}else{logger[_0xec4c('0x15')]('ChatTransferReport,\x20%s,\x20%s',_0x5e64a7,'request\x20sent');_0x3787c2(_0x3c9b92[_0xec4c('0x16')][_0xec4c('0x14')]);}})[_0xec4c('0x17')](function(_0x526fd2){logger['error'](_0xec4c('0xd'),_0x5e64a7,_0x526fd2);_0xd47b81(_0x526fd2);});});}
\ No newline at end of file
+var _0x73ef=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x463dcb,_0x92aa0b){var _0x54722b=function(_0xc25df9){while(--_0xc25df9){_0x463dcb['push'](_0x463dcb['shift']());}};_0x54722b(++_0x92aa0b);}(_0x73ef,0xdc));var _0xf73e=function(_0x4a114e,_0x4e839e){_0x4a114e=_0x4a114e-0x0;var _0x968eb3=_0x73ef[_0x4a114e];return _0x968eb3;};'use strict';var _=require(_0xf73e('0x0'));var util=require(_0xf73e('0x1'));var moment=require(_0xf73e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf73e('0x3'));var db=require(_0xf73e('0x4'))['db'];var utils=require(_0xf73e('0x5'));var logger=require(_0xf73e('0x6'))(_0xf73e('0x7'));var config=require(_0xf73e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf73e('0x9')][_0xf73e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49969,_0x26ad2a,_0x501d42){return new BPromise(function(_0x1a7f3d,_0x3f282a){return client['request'](_0x49969,_0x501d42)[_0xf73e('0xb')](function(_0x1719b1){logger[_0xf73e('0xc')](_0xf73e('0xd'),_0x26ad2a,_0xf73e('0xe'));logger[_0xf73e('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x26ad2a,'request\x20sent',JSON['stringify'](_0x1719b1));if(_0x1719b1[_0xf73e('0x10')]){if(_0x1719b1['error']['code']===0x1f4){logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x1719b1[_0xf73e('0x10')]['message']);return _0x3f282a(_0x1719b1[_0xf73e('0x10')]['message']);}logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x1719b1[_0xf73e('0x10')]['message']);return _0x1a7f3d(_0x1719b1[_0xf73e('0x10')][_0xf73e('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x26ad2a,_0xf73e('0xe'));_0x1a7f3d(_0x1719b1[_0xf73e('0x12')][_0xf73e('0x11')]);}})[_0xf73e('0x13')](function(_0x5e91ed){logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x5e91ed);_0x3f282a(_0x5e91ed);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index a41555a..fdff3a5 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 _0x2455=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','describe','isAuthenticated','show','post','create','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x53ff1b,_0xc2a0fa){var _0x34ef7d=function(_0x56f681){while(--_0x56f681){_0x53ff1b['push'](_0x53ff1b['shift']());}};_0x34ef7d(++_0xc2a0fa);}(_0x2455,0x7a));var _0x5245=function(_0x3ddefb,_0x2641f9){_0x3ddefb=_0x3ddefb-0x0;var _0x206cfc=_0x2455[_0x3ddefb];return _0x206cfc;};'use strict';var multer=require(_0x5245('0x0'));var util=require(_0x5245('0x1'));var path=require(_0x5245('0x2'));var timeout=require(_0x5245('0x3'));var express=require(_0x5245('0x4'));var router=express[_0x5245('0x5')]();var fs_extra=require(_0x5245('0x6'));var auth=require(_0x5245('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5245('0x8'));var controller=require(_0x5245('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5245('0xa')]);router[_0x5245('0xb')](_0x5245('0xc'),auth['isAuthenticated'](),controller[_0x5245('0xd')]);router[_0x5245('0xb')]('/:id',auth[_0x5245('0xe')](),controller[_0x5245('0xf')]);router[_0x5245('0x10')]('/',auth[_0x5245('0xe')](),controller[_0x5245('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x5245('0x12'),auth[_0x5245('0xe')](),controller[_0x5245('0x13')]);module[_0x5245('0x14')]=router;
\ No newline at end of file
+var _0xac93=['/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','describe','get'];(function(_0x5a7dfe,_0x3d1ab0){var _0x5a658=function(_0x485dec){while(--_0x485dec){_0x5a7dfe['push'](_0x5a7dfe['shift']());}};_0x5a658(++_0x3d1ab0);}(_0xac93,0xf0));var _0x3ac9=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xac93[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require(_0x3ac9('0x0'));var util=require(_0x3ac9('0x1'));var path=require(_0x3ac9('0x2'));var timeout=require(_0x3ac9('0x3'));var express=require(_0x3ac9('0x4'));var router=express[_0x3ac9('0x5')]();var fs_extra=require(_0x3ac9('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ac9('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0x9')]);router['get']('/describe',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0xa')]);router[_0x3ac9('0xb')](_0x3ac9('0xc'),auth['isAuthenticated'](),controller[_0x3ac9('0xd')]);router[_0x3ac9('0xe')]('/',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0xf')]);router[_0x3ac9('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3ac9('0xc'),auth[_0x3ac9('0x8')](),controller[_0x3ac9('0x11')]);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 90615c1..eb80b37 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 _0x3c81=['bottom_right','alternate','#fafafa','System','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','name','text','input','parse','getDataValue','setDataValue','onlineForm','textarea','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.','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'];(function(_0x3f417c,_0x123722){var _0x45d920=function(_0x1ce62f){while(--_0x1ce62f){_0x3f417c['push'](_0x3f417c['shift']());}};_0x45d920(++_0x123722);}(_0x3c81,0x102));var _0x13c8=function(_0x3ab056,_0x2c63d5){_0x3ab056=_0x3ab056-0x0;var _0x465cff=_0x3c81[_0x3ab056];return _0x465cff;};'use strict';var Sequelize=require(_0x13c8('0x0'));var rs=require(_0x13c8('0x1'));module['exports']={'name':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x3')},'key':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x4')},'customerAlias':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':_0x13c8('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':_0x13c8('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x13c8('0x2')]},'animation':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x13c8('0x8')](_0x13c8('0x9'),_0x13c8('0xa')),'defaultValue':_0x13c8('0x9')},'header_online':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0xb')},'start_chat_button':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0xc')},'header_offline':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x13c8('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x13c8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x11')},'placeholderMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x12')},'closingMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x13')},'closingMessageButton':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0xc')},'skipMessageButton':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x14')},'conditionAgreement':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x13c8('0x16'),_0x13c8('0x17')),'defaultValue':_0x13c8('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x13c8('0xe')],'defaultValue':function(){return JSON[_0x13c8('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x13c8('0x19'),'type':_0x13c8('0x1a'),'required':!![]},'props':{'title':_0x13c8('0x19'),'helpText':''}},{'type':_0x13c8('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x13c8('0x3'),'type':_0x13c8('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x13c8('0x1c')](this[_0x13c8('0x1d')]('onlineForm')):{};},'set':function(_0x5ad0dc){return this[_0x13c8('0x1e')](_0x13c8('0x1f'),JSON['stringify'](_0x5ad0dc));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x13c8('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x13c8('0x3'),'type':_0x13c8('0x3')},'variable':null},{'type':_0x13c8('0x20'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x13c8('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x13c8('0x1d')](_0x13c8('0x22'))?JSON[_0x13c8('0x1c')](this[_0x13c8('0x1d')](_0x13c8('0x22'))):{};},'set':function(_0x343080){return this['setDataValue'](_0x13c8('0x22'),JSON[_0x13c8('0x18')](_0x343080));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x13c8('0x2')]},'forwardOffline':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x23')},'waitingMessage':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x13c8('0x27')},'skipUnmanaged':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x13c8('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x13c8('0x2')]},'notificationTemplate':{'type':Sequelize[_0x13c8('0xe')],'defaultValue':function(){return _0x13c8('0x28');}},'notificationSound':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x2a')},'verticalAlignment':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x13c8('0x2b')},'defaultTitle':{'type':Sequelize[_0x13c8('0x2')]},'customerAvatar':{'type':Sequelize[_0x13c8('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x13c8('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':_0x13c8('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x13c8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x2d')},'systemAvatar':{'type':Sequelize[_0x13c8('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x13c8('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x343dba){if(!_0x343dba)this[_0x13c8('0x1e')](_0x13c8('0x2e'),null);this[_0x13c8('0x1e')](_0x13c8('0x2f'),_0x343dba);}},'vidaooEscalation':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x13c8('0x2')]},'vidaooTopic':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![],'defaultValue':_0x13c8('0x30')},'vidaooNote':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':function(){return _0x13c8('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x13c8('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x13c8('0xe')]}};
\ No newline at end of file
+var _0xe706=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','name','text','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x405a50,_0x1cbebf){var _0x195319=function(_0xa4e9f9){while(--_0xa4e9f9){_0x405a50['push'](_0x405a50['shift']());}};_0x195319(++_0x1cbebf);}(_0xe706,0xa3));var _0x6e70=function(_0x5b5095,_0x4518d0){_0x5b5095=_0x5b5095-0x0;var _0x54d290=_0xe706[_0x5b5095];return _0x54d290;};'use strict';var Sequelize=require(_0x6e70('0x0'));var rs=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'unique':_0x6e70('0x4')},'description':{'type':Sequelize[_0x6e70('0x3')]},'mapKey':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'key':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x6')},'customerAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6e70('0x3')]},'animation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0xc'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xd')},'start_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xe')},'offline_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'header_offline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x14')},'noteTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x16')},'closingMessageButton':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x17')},'conditionAgreement':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x18')},'ratingType':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0x19'),_0x6e70('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON[_0x6e70('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6e70('0x1d'),'type':_0x6e70('0x1e'),'required':!![]},'props':{'title':_0x6e70('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6e70('0x1f'))?JSON[_0x6e70('0x20')](this['getDataValue'](_0x6e70('0x1f'))):{};},'set':function(_0x1196ed){return this['setDataValue'](_0x6e70('0x1f'),JSON[_0x6e70('0x1c')](_0x1196ed));}},'offlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6e70('0x5'),'type':_0x6e70('0x5')},'variable':null},{'type':_0x6e70('0x21'),'config':{'placeholder':_0x6e70('0x22')},'props':{'title':'Comments','helpText':_0x6e70('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6e70('0x24')](_0x6e70('0x25'))?JSON[_0x6e70('0x20')](this[_0x6e70('0x24')](_0x6e70('0x25'))):{};},'set':function(_0x3f78d2){return this[_0x6e70('0x26')](_0x6e70('0x25'),JSON[_0x6e70('0x1c')](_0x3f78d2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6e70('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6e70('0x3')]},'forwardOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6e70('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x28')},'waitingMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return _0x6e70('0x2c');}},'notificationSound':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2e')},'verticalAlignment':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2f')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x31')},'systemAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e70('0x9')],'comment':_0x6e70('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2c0bd1){if(!_0x2c0bd1)this[_0x6e70('0x26')](_0x6e70('0x33'),null);this[_0x6e70('0x26')](_0x6e70('0x34'),_0x2c0bd1);}},'vidaooEscalation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6e70('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x6e70('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6e70('0x1b')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 83b4a57..8cf3b6c 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 _0x42ba=['Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','applications','list','orderBy','priority','account','CmContact','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','no\x20available\x20attributes','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','openNewInteraction','sequelize','Attachment','MailServerOut','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','MailAccountId','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','License','increment','chatLicenseExceeded','Intervals','all','URL','address','origin','3.1.0','remote','x-real-ip','remoteAddress','virtual','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./chatWebsite.socket','html-to-text','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','update','destroy','get','ChatWebsites','then','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','query','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','intersection','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','create','nolimit','order','removeDispositions','ids','CannedAnswer','getAnswers','findOne','include','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','setUA','headers','user-agent','chat'];(function(_0x28c117,_0x590409){var _0x397766=function(_0x1ce4c9){while(--_0x1ce4c9){_0x28c117['push'](_0x28c117['shift']());}};_0x397766(++_0x590409);}(_0x42ba,0x1cc));var _0xa42b=function(_0x29dab8,_0x428035){_0x29dab8=_0x29dab8-0x0;var _0x2bbcf3=_0x42ba[_0x29dab8];return _0x2bbcf3;};'use strict';var BPromise=require(_0xa42b('0x0'));var Mustache=require(_0xa42b('0x1'));var util=require(_0xa42b('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa42b('0x3'));var _=require(_0xa42b('0x4'));var querystring=require(_0xa42b('0x5'));var Redis=require('ioredis');var qs=require(_0xa42b('0x6'));var logger=require(_0xa42b('0x7'))(_0xa42b('0x8'));var config=require(_0xa42b('0x9'));var url=require('url');var db=require(_0xa42b('0xa'))['db'];config['redis']=_[_0xa42b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa42b('0xc'))(new Redis(config[_0xa42b('0xd')]));require(_0xa42b('0xe'))['register'](socket);var htmlToText=require(_0xa42b('0xf'));var jayson=require(_0xa42b('0x10'));var client=jayson[_0xa42b('0x11')][_0xa42b('0x12')]({'port':0x232c});var client9002=jayson[_0xa42b('0x11')][_0xa42b('0x12')]({'port':0x232a});var client9003=jayson[_0xa42b('0x11')][_0xa42b('0x12')]({'port':0x232b});var client9001=jayson[_0xa42b('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x2324d0,_0x2c1bff,_0x25dbcd,_0x271467){return new BPromise(function(_0xc67c82,_0x438a9f){var _0x4fb608=_0x271467||client;return _0x4fb608['request'](_0x2324d0,_0x25dbcd)['then'](function(_0xd7be20){logger[_0xa42b('0x13')](_0xa42b('0x14'),_0x2c1bff,'request\x20sent');logger['debug'](_0xa42b('0x15'),_0x2c1bff,_0xa42b('0x16'),JSON[_0xa42b('0x17')](_0xd7be20));if(_0xd7be20[_0xa42b('0x18')]){if(_0xd7be20[_0xa42b('0x18')][_0xa42b('0x19')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2c1bff,_0xd7be20[_0xa42b('0x18')][_0xa42b('0x1a')]);return _0x438a9f(_0xd7be20[_0xa42b('0x18')]['message']);}logger['error'](_0xa42b('0x14'),_0x2c1bff,_0xd7be20[_0xa42b('0x18')]['message']);return _0xc67c82(_0xd7be20[_0xa42b('0x18')][_0xa42b('0x1a')]);}else{logger[_0xa42b('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2c1bff,'request\x20sent');_0xc67c82(_0xd7be20['result'][_0xa42b('0x1a')]);}})[_0xa42b('0x1b')](function(_0x474790){logger[_0xa42b('0x18')](_0xa42b('0x14'),_0x2c1bff,_0x474790);_0x438a9f(_0x474790);});});}function respondWithStatusCode(_0x4db733,_0x1fae23){_0x1fae23=_0x1fae23||0xcc;return function(_0x148716){if(_0x148716){return _0x4db733[_0xa42b('0x1c')](_0x1fae23);}return _0x4db733['status'](_0x1fae23)[_0xa42b('0x1d')]();};}function respondWithResult(_0x4c15a1,_0x3ac0db){_0x3ac0db=_0x3ac0db||0xc8;return function(_0x3141d7){if(_0x3141d7){return _0x4c15a1['status'](_0x3ac0db)[_0xa42b('0x1e')](_0x3141d7);}};}function respondWithFilteredResult(_0x598f31,_0x5e562b){return function(_0x3006fc){if(_0x3006fc){var _0x1d2f34=typeof _0x5e562b[_0xa42b('0x1f')]===_0xa42b('0x20')&&typeof _0x5e562b[_0xa42b('0x21')]===_0xa42b('0x20');var _0x2f87d7=_0x3006fc[_0xa42b('0x22')];var _0x375730=_0x1d2f34?0x0:_0x5e562b[_0xa42b('0x1f')];var _0x121371=_0x1d2f34?_0x3006fc[_0xa42b('0x22')]:_0x5e562b[_0xa42b('0x1f')]+_0x5e562b[_0xa42b('0x21')];var _0xbceb2a;if(_0x121371>=_0x2f87d7){_0x121371=_0x2f87d7;_0xbceb2a=0xc8;}else{_0xbceb2a=0xce;}_0x598f31[_0xa42b('0x23')](_0xbceb2a);return _0x598f31[_0xa42b('0x24')]('Content-Range',_0x375730+'-'+_0x121371+'/'+_0x2f87d7)[_0xa42b('0x1e')](_0x3006fc);}return null;};}function saveUpdates(_0x4500a6){return function(_0x2c5011){if(_0x2c5011){return _0x2c5011[_0xa42b('0x25')](_0x4500a6)['then'](function(_0x146e00){return _0x146e00;});}return null;};}function removeEntity(_0xeef079){return function(_0x56ba5a){if(_0x56ba5a){return _0x56ba5a[_0xa42b('0x26')]()['then'](function(){var _0x3c3f9a=_0x56ba5a[_0xa42b('0x27')]({'plain':!![]});var _0x1e062f=_0xa42b('0x28');return db['UserProfileResource'][_0xa42b('0x26')]({'where':{'type':_0x1e062f,'resourceId':_0x3c3f9a['id']}})[_0xa42b('0x29')](function(){return _0x56ba5a;});})[_0xa42b('0x29')](function(){_0xeef079[_0xa42b('0x23')](0xcc)[_0xa42b('0x1d')]();});}};}function handleEntityNotFound(_0x5d9b0e){return function(_0x166368){if(!_0x166368){_0x5d9b0e[_0xa42b('0x1c')](0x194);}return _0x166368;};}function handleError(_0x44ed81,_0x2e9e7){_0x2e9e7=_0x2e9e7||0x1f4;return function(_0x20f8cc){logger[_0xa42b('0x18')](_0x20f8cc['stack']);if(_0x20f8cc['name']){delete _0x20f8cc[_0xa42b('0x2a')];}_0x44ed81[_0xa42b('0x23')](_0x2e9e7)[_0xa42b('0x2b')](_0x20f8cc);};}exports[_0xa42b('0x2c')]=function(_0x44e571,_0x12bc1e){var _0x959197={'include':[{'model':db[_0xa42b('0x2d')],'as':_0xa42b('0x2e')}]},_0x46fdeb={},_0x522c00={'count':0x0,'rows':[]};var _0x509157=_[_0xa42b('0x2f')](db[_0xa42b('0x30')]['rawAttributes'],function(_0x160b17){return{'name':_0x160b17[_0xa42b('0x31')],'type':_0x160b17['type'][_0xa42b('0x32')]};});_0x46fdeb['model']=_[_0xa42b('0x2f')](_0x509157,'name');_0x46fdeb[_0xa42b('0x33')]=_['keys'](_0x44e571[_0xa42b('0x33')]);_0x46fdeb['filters']=_['intersection'](_0x46fdeb[_0xa42b('0x34')],_0x46fdeb[_0xa42b('0x33')]);_0x959197[_0xa42b('0x35')]=_['intersection'](_0x46fdeb['model'],qs[_0xa42b('0x36')](_0x44e571[_0xa42b('0x33')][_0xa42b('0x36')]));_0x959197[_0xa42b('0x35')]=_0x959197[_0xa42b('0x35')][_0xa42b('0x37')]?_0x959197[_0xa42b('0x35')]:_0x46fdeb[_0xa42b('0x34')];if(!_0x44e571['query'][_0xa42b('0x38')]('nolimit')){_0x959197[_0xa42b('0x21')]=qs[_0xa42b('0x21')](_0x44e571[_0xa42b('0x33')][_0xa42b('0x21')]);_0x959197['offset']=qs[_0xa42b('0x1f')](_0x44e571[_0xa42b('0x33')][_0xa42b('0x1f')]);}_0x959197['order']=qs['sort'](_0x44e571['query'][_0xa42b('0x39')]);_0x959197[_0xa42b('0x3a')]=qs['filters'](_[_0xa42b('0x3b')](_0x44e571[_0xa42b('0x33')],_0x46fdeb[_0xa42b('0x3c')]),_0x509157);if(_0x44e571['query'][_0xa42b('0x3d')]){_0x959197[_0xa42b('0x3a')]=_[_0xa42b('0x3e')](_0x959197['where'],{'$or':_[_0xa42b('0x2f')](_0x509157,function(_0x59ba97){if(_0x59ba97['type']!==_0xa42b('0x3f')){var _0x5218a6={};_0x5218a6[_0x59ba97[_0xa42b('0x2a')]]={'$like':'%'+_0x44e571[_0xa42b('0x33')][_0xa42b('0x3d')]+'%'};return _0x5218a6;}})});}_0x959197=_['merge']({},_0x959197,_0x44e571[_0xa42b('0x40')]);var _0xcf5dae={'where':_0x959197['where']};return db[_0xa42b('0x30')][_0xa42b('0x22')](_0xcf5dae)['then'](function(_0x3dff35){_0x522c00[_0xa42b('0x22')]=_0x3dff35;if(_0x44e571[_0xa42b('0x33')][_0xa42b('0x41')]){_0x959197['include']=[{'all':!![]}];}return db[_0xa42b('0x30')][_0xa42b('0x42')](_0x959197);})[_0xa42b('0x29')](function(_0xc5ad90){_0x522c00[_0xa42b('0x43')]=_0xc5ad90;return _0x522c00;})[_0xa42b('0x29')](respondWithFilteredResult(_0x12bc1e,_0x959197))[_0xa42b('0x1b')](handleError(_0x12bc1e,null));};exports[_0xa42b('0x44')]=function(_0x2cc036,_0x5372ff){var _0x2c2a71={'raw':![],'where':{'id':_0x2cc036[_0xa42b('0x45')]['id']},'include':[{'model':db['Pause'],'as':_0xa42b('0x2e')}]},_0x12b02a={};_0x12b02a[_0xa42b('0x34')]=_[_0xa42b('0x46')](db[_0xa42b('0x30')][_0xa42b('0x47')]);_0x12b02a['query']=_[_0xa42b('0x46')](_0x2cc036['query']);_0x12b02a[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x12b02a['model'],_0x12b02a[_0xa42b('0x33')]);_0x2c2a71[_0xa42b('0x35')]=_['intersection'](_0x12b02a[_0xa42b('0x34')],qs['fields'](_0x2cc036[_0xa42b('0x33')][_0xa42b('0x36')]));_0x2c2a71[_0xa42b('0x35')]=_0x2c2a71[_0xa42b('0x35')]['length']?_0x2c2a71[_0xa42b('0x35')]:_0x12b02a[_0xa42b('0x34')];if(_0x2cc036[_0xa42b('0x33')][_0xa42b('0x41')]){_0x2c2a71['include']=[{'all':!![]}];}_0x2c2a71=_[_0xa42b('0x3e')]({},_0x2c2a71,_0x2cc036['options']);return db[_0xa42b('0x30')]['find'](_0x2c2a71)['then'](handleEntityNotFound(_0x5372ff,null))[_0xa42b('0x29')](respondWithResult(_0x5372ff,null))[_0xa42b('0x1b')](handleError(_0x5372ff,null));};exports['create']=function(_0x515aea,_0x117863){return db[_0xa42b('0x30')]['create'](_0x515aea[_0xa42b('0x49')],{})[_0xa42b('0x29')](function(_0x4c25b1){var _0x28c251=_0x515aea[_0xa42b('0x4a')][_0xa42b('0x27')]({'plain':!![]});if(!_0x28c251)throw new Error(_0xa42b('0x4b'));if(_0x28c251[_0xa42b('0x4c')]===_0xa42b('0x4a')){var _0x353334=_0x4c25b1[_0xa42b('0x27')]({'plain':!![]});var _0x67cf30=_0xa42b('0x28');return db[_0xa42b('0x4d')][_0xa42b('0x4e')]({'where':{'name':_0x67cf30,'userProfileId':_0x28c251['userProfileId']},'raw':!![]})['then'](function(_0x4bfbcd){if(_0x4bfbcd&&_0x4bfbcd['autoAssociation']===0x0){return db[_0xa42b('0x4f')]['create']({'name':_0x353334['name'],'resourceId':_0x353334['id'],'type':_0x4bfbcd['name'],'sectionId':_0x4bfbcd['id']},{})[_0xa42b('0x29')](function(){return _0x4c25b1;});}else{return _0x4c25b1;}})['catch'](function(_0x5789a0){logger['error'](_0xa42b('0x50'),_0x5789a0);throw _0x5789a0;});}return _0x4c25b1;})[_0xa42b('0x29')](respondWithResult(_0x117863,0xc9))[_0xa42b('0x1b')](handleError(_0x117863,null));};exports[_0xa42b('0x25')]=function(_0x5da301,_0x39332a){if(_0x5da301['body']['id']){delete _0x5da301[_0xa42b('0x49')]['id'];}return db[_0xa42b('0x30')]['find']({'where':{'id':_0x5da301[_0xa42b('0x45')]['id']},'include':[{'model':db[_0xa42b('0x2d')],'as':_0xa42b('0x2e')}]})[_0xa42b('0x29')](handleEntityNotFound(_0x39332a,null))[_0xa42b('0x29')](saveUpdates(_0x5da301[_0xa42b('0x49')],null))['then'](respondWithResult(_0x39332a,null))[_0xa42b('0x1b')](handleError(_0x39332a,null));};exports['destroy']=function(_0x31cb8d,_0x2eb488){return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x31cb8d[_0xa42b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2eb488,null))['then'](removeEntity(_0x2eb488,null))[_0xa42b('0x1b')](handleError(_0x2eb488,null));};exports['describe']=function(_0x475331,_0x563162){return db[_0xa42b('0x30')][_0xa42b('0x51')]()[_0xa42b('0x29')](respondWithResult(_0x563162,null))[_0xa42b('0x1b')](handleError(_0x563162,null));};exports[_0xa42b('0x52')]=function(_0x1c66e2,_0x5d6082){if(_0x1c66e2[_0xa42b('0x49')]['id']){delete _0x1c66e2['body']['id'];}return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x1c66e2[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5d6082,null))['then'](function(_0x44cb2d){if(_0x44cb2d){_0x1c66e2['body'][_0xa42b('0x53')]=_0x44cb2d['id'];return db[_0xa42b('0x54')][_0xa42b('0x55')](_0x1c66e2['body']);}})[_0xa42b('0x29')](respondWithResult(_0x5d6082,null))['catch'](handleError(_0x5d6082,null));};exports['getDispositions']=function(_0x2a1d38,_0x382b31){var _0x350b77={'raw':![],'where':{}};var _0x630384={};var _0x2c3ef4={'count':0x0,'rows':[]};return db[_0xa42b('0x30')]['findOne']({'where':{'id':_0x2a1d38[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x382b31,null))[_0xa42b('0x29')](function(_0x1a5d71){if(_0x1a5d71){_0x630384['model']=_['keys'](db[_0xa42b('0x54')]['rawAttributes']);_0x630384[_0xa42b('0x33')]=_['keys'](_0x2a1d38[_0xa42b('0x33')]);_0x630384[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x630384[_0xa42b('0x34')],_0x630384['query']);_0x350b77['attributes']=_[_0xa42b('0x48')](_0x630384['model'],qs[_0xa42b('0x36')](_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x36')]));_0x350b77[_0xa42b('0x35')]=_0x350b77[_0xa42b('0x35')][_0xa42b('0x37')]?_0x350b77['attributes']:_0x630384[_0xa42b('0x34')];if(!_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x38')](_0xa42b('0x56'))){_0x350b77[_0xa42b('0x21')]=qs['limit'](_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x21')]);_0x350b77['offset']=qs[_0xa42b('0x1f')](_0x2a1d38[_0xa42b('0x33')]['offset']);}_0x350b77[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x39')]);_0x350b77[_0xa42b('0x3a')]=qs[_0xa42b('0x3c')](_['pick'](_0x2a1d38[_0xa42b('0x33')],_0x630384[_0xa42b('0x3c')]));_0x350b77['where'][_0xa42b('0x53')]=_0x1a5d71['id'];if(_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x350b77[_0xa42b('0x3a')]=_[_0xa42b('0x3e')](_0x350b77['where'],{'$or':_['map'](_0x350b77['attributes'],function(_0x2ff7d9){var _0x159c19={};_0x159c19[_0x2ff7d9]={'$like':'%'+_0x2a1d38[_0xa42b('0x33')]['filter']+'%'};return _0x159c19;})});}_0x350b77=_['merge']({},_0x350b77,_0x2a1d38[_0xa42b('0x40')]);return db[_0xa42b('0x54')][_0xa42b('0x22')]({'where':_0x350b77[_0xa42b('0x3a')]})[_0xa42b('0x29')](function(_0x35a8e7){_0x2c3ef4['count']=_0x35a8e7;if(_0x2a1d38[_0xa42b('0x33')][_0xa42b('0x41')]){_0x350b77['include']=[{'all':!![]}];}return db[_0xa42b('0x54')]['findAll'](_0x350b77);})[_0xa42b('0x29')](function(_0x2d2f07){_0x2c3ef4[_0xa42b('0x43')]=_0x2d2f07;return _0x2c3ef4;});}})[_0xa42b('0x29')](respondWithFilteredResult(_0x382b31,_0x350b77))[_0xa42b('0x1b')](handleError(_0x382b31,null));};exports['removeDispositions']=function(_0x670a8c,_0x5096c0){return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x670a8c['params']['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5096c0,null))[_0xa42b('0x29')](function(_0x5c33b9){if(_0x5c33b9){return _0x5c33b9[_0xa42b('0x58')](_0x670a8c[_0xa42b('0x33')][_0xa42b('0x59')]);}})[_0xa42b('0x29')](respondWithStatusCode(_0x5096c0,null))['catch'](handleError(_0x5096c0,null));};exports['addAnswer']=function(_0x4a34c6,_0x5923e7){if(_0x4a34c6['body']['id']){delete _0x4a34c6[_0xa42b('0x49')]['id'];}return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x4a34c6[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5923e7,null))[_0xa42b('0x29')](function(_0x51cc8a){if(_0x51cc8a){_0x4a34c6[_0xa42b('0x49')]['ChatWebsiteId']=_0x51cc8a['id'];return db[_0xa42b('0x5a')][_0xa42b('0x55')](_0x4a34c6[_0xa42b('0x49')]);}})[_0xa42b('0x29')](respondWithResult(_0x5923e7,null))['catch'](handleError(_0x5923e7,null));};exports[_0xa42b('0x5b')]=function(_0x24bb64,_0x5d72be){var _0x30557c={'raw':![],'where':{}};var _0x2532bf={};var _0x586656={'count':0x0,'rows':[]};return db[_0xa42b('0x30')][_0xa42b('0x5c')]({'where':{'id':_0x24bb64[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5d72be,null))[_0xa42b('0x29')](function(_0x3f12c8){if(_0x3f12c8){_0x2532bf[_0xa42b('0x34')]=_[_0xa42b('0x46')](db[_0xa42b('0x5a')]['rawAttributes']);_0x2532bf[_0xa42b('0x33')]=_[_0xa42b('0x46')](_0x24bb64[_0xa42b('0x33')]);_0x2532bf[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x2532bf['model'],_0x2532bf[_0xa42b('0x33')]);_0x30557c['attributes']=_['intersection'](_0x2532bf['model'],qs[_0xa42b('0x36')](_0x24bb64['query'][_0xa42b('0x36')]));_0x30557c[_0xa42b('0x35')]=_0x30557c[_0xa42b('0x35')][_0xa42b('0x37')]?_0x30557c['attributes']:_0x2532bf['model'];if(!_0x24bb64['query'][_0xa42b('0x38')](_0xa42b('0x56'))){_0x30557c['limit']=qs[_0xa42b('0x21')](_0x24bb64['query']['limit']);_0x30557c['offset']=qs[_0xa42b('0x1f')](_0x24bb64[_0xa42b('0x33')][_0xa42b('0x1f')]);}_0x30557c[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x24bb64[_0xa42b('0x33')][_0xa42b('0x39')]);_0x30557c[_0xa42b('0x3a')]=qs[_0xa42b('0x3c')](_[_0xa42b('0x3b')](_0x24bb64[_0xa42b('0x33')],_0x2532bf[_0xa42b('0x3c')]));_0x30557c[_0xa42b('0x3a')]['ChatWebsiteId']=_0x3f12c8['id'];if(_0x24bb64[_0xa42b('0x33')]['filter']){_0x30557c[_0xa42b('0x3a')]=_[_0xa42b('0x3e')](_0x30557c[_0xa42b('0x3a')],{'$or':_[_0xa42b('0x2f')](_0x30557c[_0xa42b('0x35')],function(_0x383873){var _0x564c1e={};_0x564c1e[_0x383873]={'$like':'%'+_0x24bb64[_0xa42b('0x33')]['filter']+'%'};return _0x564c1e;})});}_0x30557c=_[_0xa42b('0x3e')]({},_0x30557c,_0x24bb64[_0xa42b('0x40')]);return db['CannedAnswer'][_0xa42b('0x22')]({'where':_0x30557c[_0xa42b('0x3a')]})[_0xa42b('0x29')](function(_0x192060){_0x586656[_0xa42b('0x22')]=_0x192060;if(_0x24bb64[_0xa42b('0x33')][_0xa42b('0x41')]){_0x30557c[_0xa42b('0x5d')]=[{'all':!![]}];}return db[_0xa42b('0x5a')]['findAll'](_0x30557c);})[_0xa42b('0x29')](function(_0x55a746){_0x586656[_0xa42b('0x43')]=_0x55a746;return _0x586656;});}})[_0xa42b('0x29')](respondWithFilteredResult(_0x5d72be,_0x30557c))[_0xa42b('0x1b')](handleError(_0x5d72be,null));};exports[_0xa42b('0x5e')]=function(_0x24ee36,_0x2cc1e0){return db['ChatWebsite']['find']({'where':{'id':_0x24ee36['params']['id']}})['then'](handleEntityNotFound(_0x2cc1e0,null))[_0xa42b('0x29')](function(_0x27beb6){if(_0x27beb6){return _0x27beb6['removeAnswers'](_0x24ee36[_0xa42b('0x33')][_0xa42b('0x59')]);}})[_0xa42b('0x29')](respondWithStatusCode(_0x2cc1e0,null))[_0xa42b('0x1b')](handleError(_0x2cc1e0,null));};exports[_0xa42b('0x5f')]=function(_0x4a6ba4,_0x2c884d){_0x4a6ba4[_0xa42b('0x49')][_0xa42b('0x60')]=_0x4a6ba4[_0xa42b('0x61')][_0xa42b('0x62')];return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x4a6ba4['params']['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x2c884d,null))['then'](saveUpdates(_0x4a6ba4[_0xa42b('0x49')],null))['then'](respondWithResult(_0x2c884d,null))['catch'](handleError(_0x2c884d,null));};exports['addAvatar']=function(_0x6deffc,_0x5eb8ce){_0x6deffc[_0xa42b('0x49')][_0xa42b('0x63')]=_0x6deffc['file'][_0xa42b('0x62')];return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x6deffc[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5eb8ce,null))[_0xa42b('0x29')](saveUpdates(_0x6deffc[_0xa42b('0x49')],null))[_0xa42b('0x29')](respondWithResult(_0x5eb8ce,null))['catch'](handleError(_0x5eb8ce,null));};exports[_0xa42b('0x64')]=function(_0x5b21f9,_0x3bff96){_0x5b21f9[_0xa42b('0x49')]['customerAvatar']=_0x5b21f9[_0xa42b('0x61')][_0xa42b('0x62')];return db[_0xa42b('0x30')]['find']({'where':{'id':_0x5b21f9['params']['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x3bff96,null))[_0xa42b('0x29')](saveUpdates(_0x5b21f9[_0xa42b('0x49')],null))[_0xa42b('0x29')](respondWithResult(_0x3bff96,null))[_0xa42b('0x1b')](handleError(_0x3bff96,null));};exports['addSystemAvatar']=function(_0x19aacb,_0x5cd347){_0x19aacb[_0xa42b('0x49')][_0xa42b('0x65')]=_0x19aacb[_0xa42b('0x61')][_0xa42b('0x62')];return db[_0xa42b('0x30')]['find']({'where':{'id':_0x19aacb[_0xa42b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cd347,null))['then'](saveUpdates(_0x19aacb[_0xa42b('0x49')],null))['then'](respondWithResult(_0x5cd347,null))[_0xa42b('0x1b')](handleError(_0x5cd347,null));};exports['getLogo']=function(_0x250b99,_0x2bff53){var _0x12253d=path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0x68'));var _0x4d7455={'where':{'id':_0x250b99[_0xa42b('0x45')]['id']},'attributes':['id',_0xa42b('0x60')],'raw':!![]};var _0x1320b7=![];return require(_0xa42b('0x69'))[_0xa42b('0x6a')]()['then'](function(_0x46a595){if(_0x46a595){_0x1320b7=_0x46a595[_0xa42b('0x6b')];}})['then'](function(){return db[_0xa42b('0x30')][_0xa42b('0x4e')](_0x4d7455);})[_0xa42b('0x29')](handleEntityNotFound(_0x2bff53,null))[_0xa42b('0x29')](function(_0x4b880b){if(_0x4b880b){if(!_['isNil'](_0x4b880b[_0xa42b('0x60')])){if(fs['existsSync'](path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0x6c'),_0x4b880b['sitepic']))&&_0x1320b7){_0x12253d=path[_0xa42b('0x66')](config['root'],_0xa42b('0x6c'),_0x4b880b[_0xa42b('0x60')]);}}return _0x2bff53[_0xa42b('0x6d')](_0x12253d);}})[_0xa42b('0x1b')](handleError(_0x2bff53,null));};exports['getAvatar']=function(_0x35c8bc,_0x55af52){var _0x693510=path['join'](config[_0xa42b('0x67')],_0xa42b('0x6e'));var _0x5eb571={'where':{'id':_0x35c8bc[_0xa42b('0x45')]['id']},'attributes':['id',_0xa42b('0x63')],'raw':!![]};return db[_0xa42b('0x30')]['find'](_0x5eb571)[_0xa42b('0x29')](handleEntityNotFound(_0x55af52,null))[_0xa42b('0x29')](function(_0x1fb76b){if(_0x1fb76b){if(!_[_0xa42b('0x6f')](_0x1fb76b[_0xa42b('0x63')])){if(fs[_0xa42b('0x70')](path['join'](config[_0xa42b('0x67')],_0xa42b('0x71'),_0x1fb76b[_0xa42b('0x63')]))){_0x693510=path[_0xa42b('0x66')](config['root'],_0xa42b('0x71'),_0x1fb76b[_0xa42b('0x63')]);}}return _0x55af52['download'](_0x693510);}})[_0xa42b('0x1b')](handleError(_0x55af52,null));};exports['getCustomerAvatar']=function(_0x59844c,_0x30d8f1){var _0x212121=path[_0xa42b('0x66')](config[_0xa42b('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x42e62b={'where':{'id':_0x59844c[_0xa42b('0x45')]['id']},'attributes':['id',_0xa42b('0x72'),_0xa42b('0x73')],'raw':!![]};return db[_0xa42b('0x30')][_0xa42b('0x4e')](_0x42e62b)[_0xa42b('0x29')](handleEntityNotFound(_0x30d8f1,null))[_0xa42b('0x29')](function(_0x51fa73){if(_0x51fa73){if(!_[_0xa42b('0x6f')](_0x51fa73[_0xa42b('0x72')])){if(fs[_0xa42b('0x70')](path[_0xa42b('0x66')](config['root'],'server/files/images/avatars/',_0x51fa73[_0xa42b('0x72')]))&&_0x51fa73['showCustomerAvatar']){_0x212121=path[_0xa42b('0x66')](config[_0xa42b('0x67')],'server/files/images/avatars/',_0x51fa73['customerAvatar']);}}return _0x30d8f1[_0xa42b('0x6d')](_0x212121);}})[_0xa42b('0x1b')](handleError(_0x30d8f1,null));};exports[_0xa42b('0x74')]=function(_0x4359be,_0x4ad7e3){var _0x3dab56=path[_0xa42b('0x66')](config[_0xa42b('0x67')],'server/files/images/avatars/system_avatar.png');var _0x4723a5={'where':{'id':_0x4359be[_0xa42b('0x45')]['id']},'attributes':['id',_0xa42b('0x65')],'raw':!![]};return db[_0xa42b('0x30')][_0xa42b('0x4e')](_0x4723a5)['then'](handleEntityNotFound(_0x4ad7e3,null))[_0xa42b('0x29')](function(_0x568b98){if(_0x568b98){if(!_[_0xa42b('0x6f')](_0x568b98[_0xa42b('0x65')])){if(fs[_0xa42b('0x70')](path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0x71'),_0x568b98[_0xa42b('0x65')]))){_0x3dab56=path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0x71'),_0x568b98[_0xa42b('0x65')]);}}return _0x4ad7e3[_0xa42b('0x6d')](_0x3dab56);}})[_0xa42b('0x1b')](handleError(_0x4ad7e3,null));};exports[_0xa42b('0x75')]=function(_0x38ba41,_0x4b22bd){var _0x54228b=require('user-agent-parser');var _0x2ad523=new _0x54228b();var _0x30be3a=_0x2ad523[_0xa42b('0x76')](_0x38ba41[_0xa42b('0x77')][_0xa42b('0x78')])['getResult']();var _0xd0d849={'body':_0x38ba41['body'],'channel':_0xa42b('0x79')};var _0x94e135=[];var _0x306b75=[];var _0x58b048={};var _0x27e25c=![];return db['CmContact'][_0xa42b('0x51')]()[_0xa42b('0x29')](function(_0x417c65){if(!_0x417c65){throw new db[(_0xa42b('0x7a'))][(_0xa42b('0x7b'))]('no\x20available\x20attributes');}_0x94e135=_[_0xa42b('0x7c')](_[_0xa42b('0x46')](_0x417c65),['createdAt','updatedAt']);_0x306b75=_[_0xa42b('0x7c')](_[_0xa42b('0x46')](_0x417c65),[_0xa42b('0x7d'),_0xa42b('0x7e'),'CompanyId',_0xa42b('0x7f')]);if(_0x38ba41['body']['id']){delete _0x38ba41[_0xa42b('0x49')]['id'];}if(_[_0xa42b('0x6f')](_0x38ba41[_0xa42b('0x49')][_0xa42b('0x80')])){throw new db[(_0xa42b('0x7a'))][(_0xa42b('0x7b'))](_0xa42b('0x81'));}if(_[_0xa42b('0x6f')](_0x38ba41[_0xa42b('0x49')][_0xa42b('0x49')])||_0x38ba41[_0xa42b('0x49')][_0xa42b('0x49')]===''){throw new db['Sequelize'][(_0xa42b('0x7b'))](_0xa42b('0x82'));}if(_[_0xa42b('0x6f')](_0x38ba41['body'][_0xa42b('0x83')])){throw new db['Sequelize']['ValidationError'](_0xa42b('0x84')+_0x306b75);}if(!_[_0xa42b('0x85')](_0x306b75,_0x38ba41[_0xa42b('0x49')]['mapKey'])){throw new db[(_0xa42b('0x7a'))][(_0xa42b('0x7b'))](_0xa42b('0x86')+_0x306b75);}_0x58b048[_0x38ba41[_0xa42b('0x49')][_0xa42b('0x83')]]=_0x38ba41['body'][_0xa42b('0x80')];})[_0xa42b('0x29')](function(){return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x38ba41[_0xa42b('0x45')]['id']},'include':[{'model':db[_0xa42b('0x87')],'as':_0xa42b('0x88'),'include':[{'model':db['CmContact'],'as':_0xa42b('0x89'),'where':_0x58b048,'limit':0x1,'order':[[_0xa42b('0x7e'),'DESC']]}]},{'model':db[_0xa42b('0x8a')],'as':_0xa42b('0x8b')}]});})[_0xa42b('0x29')](handleEntityNotFound(_0x4b22bd,null))[_0xa42b('0x29')](function(_0x1e120e){if(_0x1e120e&&_0x1e120e[_0xa42b('0x88')]){_0xd0d849['account']=_0x1e120e;_0xd0d849[_0xa42b('0x8c')]=_0x1e120e[_0xa42b('0x8b')];_0xd0d849[_0xa42b('0x8d')]=_0x1e120e[_0xa42b('0x88')];_0xd0d849[_0xa42b('0x8c')]=_[_0xa42b('0x8e')](_0xd0d849['applications'],[_0xa42b('0x8f')],['asc']);if(_0xd0d849[_0xa42b('0x90')][_0xa42b('0x8b')]){delete _0xd0d849[_0xa42b('0x90')][_0xa42b('0x8b')];}if(_0xd0d849['account'][_0xa42b('0x88')]&&_0xd0d849[_0xa42b('0x90')][_0xa42b('0x88')][_0xa42b('0x89')][_0xa42b('0x37')]){return _0xd0d849['account'][_0xa42b('0x88')][_0xa42b('0x89')][0x0];}var _0x1a1dc7=_[_0xa42b('0xb')](_0x38ba41[_0xa42b('0x49')],{'firstName':_0x38ba41[_0xa42b('0x49')]['from'],'ListId':_0x1e120e[_0xa42b('0x7f')]});_0x1a1dc7[_0x38ba41['body'][_0xa42b('0x83')]]=_0x38ba41[_0xa42b('0x49')]['from'];return db[_0xa42b('0x91')][_0xa42b('0x55')](_0x1a1dc7,{'fields':_0x94e135,'raw':!![]});}})['then'](handleEntityNotFound(_0x4b22bd,null))['then'](function(_0x4a3d34){_0xd0d849[_0xa42b('0x92')]=_0x4a3d34;var _0x41ed92=_0x38ba41[_0xa42b('0x49')][_0xa42b('0x93')];if(_0x38ba41[_0xa42b('0x77')][_0xa42b('0x94')]){_0x41ed92=_0x38ba41[_0xa42b('0x77')][_0xa42b('0x94')];}else if(_0x38ba41[_0xa42b('0x77')][_0xa42b('0x95')]){_0x41ed92=_['first'](_0x38ba41[_0xa42b('0x77')][_0xa42b('0x95')][_0xa42b('0x96')](','));}if(_0x4a3d34){var _0xa723af={'ContactId':_0x4a3d34['id'],'ChatWebsiteId':_0x38ba41['params']['id'],'from':(_0x4a3d34[_0xa42b('0x97')]||'')+'\x20'+(_0x4a3d34[_0xa42b('0x98')]||''),'customerIp':_0x41ed92,'customerPort':_0x38ba41[_0xa42b('0x77')][_0xa42b('0x99')]?_0x38ba41['headers']['x-real-port']:null,'referer':_0x38ba41['body'][_0xa42b('0x9a')],'browserName':_0x30be3a[_0xa42b('0x9b')][_0xa42b('0x2a')]&&_0x30be3a['browser'][_0xa42b('0x9c')]?util[_0xa42b('0x9d')]('%s\x20%s',_0x30be3a[_0xa42b('0x9b')][_0xa42b('0x2a')],_0x30be3a[_0xa42b('0x9b')][_0xa42b('0x9c')]):_0xa42b('0x9e'),'browserVersion':_0x30be3a[_0xa42b('0x9b')][_0xa42b('0x9c')]||'unknown','osName':util[_0xa42b('0x9d')](_0xa42b('0x9f'),_0x30be3a['os'][_0xa42b('0x2a')],_0x30be3a['os'][_0xa42b('0x9c')]),'osVersion':_0x30be3a['os'][_0xa42b('0x9c')],'deviceModel':_0x30be3a[_0xa42b('0xa0')][_0xa42b('0x34')]&&_0x30be3a[_0xa42b('0xa0')][_0xa42b('0xa1')]?util['format'](_0xa42b('0xa2'),_0x30be3a[_0xa42b('0xa0')][_0xa42b('0x34')],_0x30be3a[_0xa42b('0xa0')]['vendor'],_0x30be3a[_0xa42b('0xa0')][_0xa42b('0xa3')]):null,'deviceVendor':_0x30be3a[_0xa42b('0xa0')][_0xa42b('0xa1')],'deviceType':_0x30be3a[_0xa42b('0xa0')][_0xa42b('0xa3')],'formData':JSON[_0xa42b('0x17')](_0x38ba41[_0xa42b('0x49')])};var _0x43c736={'ChatWebsiteId':_0x38ba41['params']['id'],'closed':![]};if(_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa4')]){_0x43c736[_0xa42b('0xa4')]=_0x38ba41['body'][_0xa42b('0xa4')];return db[_0xa42b('0xa5')][_0xa42b('0x4e')]({'where':_0x43c736})[_0xa42b('0x29')](function(_0x554a94){if(_0x554a94){return[_0x554a94,![]];}_0xa723af[_0xa42b('0xa4')]=_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa4')];_0xa723af[_0xa42b('0xa6')]=_0x38ba41[_0xa42b('0x49')]['externalUrl'];return db['ChatInteraction'][_0xa42b('0x55')](_0xa723af)['then'](function(_0x475746){return[_0x475746,!![]];});});}_0x43c736[_0xa42b('0xa7')]=_0x4a3d34['id'];if(_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa8')]&&_0x38ba41['body'][_0xa42b('0xa8')]['id']){_0x43c736['id']=_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa8')]['id'];return db[_0xa42b('0xa5')]['find']({'where':_0x43c736})[_0xa42b('0x29')](function(_0x36644f){if(_0x36644f){return[_0x36644f,![]];}return db['ChatInteraction']['create'](_0xa723af)[_0xa42b('0x29')](function(_0x4508ba){return[_0x4508ba,!![]];});});}return db[_0xa42b('0xa5')][_0xa42b('0x55')](_0xa723af)[_0xa42b('0x29')](function(_0x16d1ae){return[_0x16d1ae,!![]];});}})[_0xa42b('0xa9')](function(_0x18ad21,_0x5e37be){if(_0x18ad21){_0x27e25c=_0x5e37be;if(!_0x5e37be){var _0x347e60={'from':(_0xd0d849[_0xa42b('0x92')][_0xa42b('0x97')]||'')+'\x20'+(_0xd0d849[_0xa42b('0x92')][_0xa42b('0x98')]||'')};if(_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa4')]&&_0x38ba41['body'][_0xa42b('0xaa')]&&_0x38ba41[_0xa42b('0x49')][_0xa42b('0xa4')]!=_0x38ba41[_0xa42b('0x49')][_0xa42b('0xaa')]){_0x347e60[_0xa42b('0xa4')]=_0x38ba41[_0xa42b('0x49')][_0xa42b('0xaa')];}return _0x18ad21[_0xa42b('0x25')](_0x347e60);}else{return _0x18ad21;}}})[_0xa42b('0x29')](function(_0x25a714){_0xd0d849[_0xa42b('0xa8')]=_0x25a714[_0xa42b('0x27')]({'plain':!![]});_0xd0d849[_0xa42b('0xa8')][_0xa42b('0xab')]=_0x27e25c;if(_0xd0d849[_0xa42b('0xa8')][_0xa42b('0xab')]){if(_0xd0d849[_0xa42b('0x90')][_0xa42b('0xac')]){_0xd0d849[_0xa42b('0x8c')][_0xa42b('0xad')]({'id':0x0,'priority':_0xd0d849[_0xa42b('0x8c')]['length']+0x1,'app':_0xa42b('0xae'),'appdata':_0xa42b('0xaf'),'interval':_0xa42b('0xb0')});}}return db[_0xa42b('0xb1')][_0xa42b('0x55')]({'body':_0x38ba41['body'][_0xa42b('0x49')],'ChatWebsiteId':_0x38ba41[_0xa42b('0x45')]['id'],'ChatInteractionId':_0x25a714['id'],'direction':'in','ContactId':_0xd0d849['contact']['id'],'AttachmentId':_0x38ba41['body'][_0xa42b('0xb2')]});})[_0xa42b('0x29')](function(_0x425e60){_0xd0d849[_0xa42b('0x1a')]=_0x425e60;if(_0xd0d849[_0xa42b('0xa8')][_0xa42b('0xb3')]){return db[_0xa42b('0xb4')][_0xa42b('0x4e')]({'attributes':['id',_0xa42b('0x2a')],'where':{'id':_0xd0d849[_0xa42b('0xa8')][_0xa42b('0xb3')]}})[_0xa42b('0x29')](function(_0x371e8c){if(_0x371e8c){_0xd0d849['applications'][_0xa42b('0xb5')]({'id':0x0,'priority':0x0,'app':_0xa42b('0xb6'),'appdata':_0x371e8c[_0xa42b('0x2a')]+','+(_0xd0d849['account'][_0xa42b('0xb7')]||0xa),'interval':_0xa42b('0xb0')});_0xd0d849[_0xa42b('0xb8')]=!![];}return respondWithRpcPromise('Start',_0xa42b('0xb9'),_0xd0d849);});}return respondWithRpcPromise(_0xa42b('0xba'),_0xa42b('0xb9'),_0xd0d849);})[_0xa42b('0x29')](function(_0x51a965){respondWithRpcPromise('EventManager',_0xa42b('0xbb'),{'event':'notify','message':_0x51a965},client9002);return _0x51a965;})['then'](respondWithResult(_0x4b22bd,null))['catch'](handleError(_0x4b22bd,null));};exports[_0xa42b('0xbc')]=function(_0x11c82b,_0x5570c9){var _0x19da34,_0x3299f8,_0x52618e;var _0x3c993a=[];var _0x1a18c2={};var _0x2e7c5f=_0x11c82b[_0xa42b('0xbd')]||[];var _0xadad39=[];var _0x465c73;return db['CmContact']['describe']()[_0xa42b('0x29')](function(_0x25b4c7){if(!_0x25b4c7){throw new db[(_0xa42b('0x7a'))][(_0xa42b('0x7b'))](_0xa42b('0xbe'));}_0x3c993a=_[_0xa42b('0x7c')](_[_0xa42b('0x46')](_0x25b4c7),[_0xa42b('0x7d'),_0xa42b('0x7e'),_0xa42b('0xbf'),_0xa42b('0x7f')]);if(_0x11c82b[_0xa42b('0x49')]['id']){delete _0x11c82b[_0xa42b('0x49')]['id'];}if(_['isNil'](_0x11c82b['body'][_0xa42b('0x80')])){throw _0x5570c9['status'](0x1f4)[_0xa42b('0x2b')](new db[(_0xa42b('0x7a'))]['ValidationError'](_0xa42b('0x81')));}if(_[_0xa42b('0x6f')](_0x11c82b[_0xa42b('0x49')][_0xa42b('0x49')])||_0x11c82b[_0xa42b('0x49')][_0xa42b('0x49')]===''){throw _0x5570c9['status'](0x1f4)[_0xa42b('0x2b')](new db['Sequelize']['ValidationError'](_0xa42b('0x82')));}if(_[_0xa42b('0x6f')](_0x11c82b[_0xa42b('0x49')][_0xa42b('0xc0')])){throw _0x5570c9[_0xa42b('0x23')](0x1f4)['send'](new db[(_0xa42b('0x7a'))]['ValidationError'](_0xa42b('0xc1')+_0x3c993a));}if(!_['includes'](_0x3c993a,_0x11c82b[_0xa42b('0x49')][_0xa42b('0xc0')])){throw _0x5570c9[_0xa42b('0x23')](0x1f4)['send'](new db['Sequelize'][(_0xa42b('0x7b'))](_0xa42b('0xc2')+_0x3c993a));}_0x1a18c2[_0x11c82b[_0xa42b('0x49')][_0xa42b('0xc0')]]=_0x11c82b['body'][_0xa42b('0x80')];})[_0xa42b('0x29')](function(){return db[_0xa42b('0x30')]['find']({'where':{'id':_0x11c82b['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0xa42b('0xc3')}]});})['then'](handleEntityNotFound(_0x5570c9,null))[_0xa42b('0x29')](function(_0x4e43ae){if(_0x4e43ae&&_0x4e43ae[_0xa42b('0x88')]){_0x3299f8=_0x4e43ae;var _0x633811=_['defaults'](_0x11c82b['body'],{'firstName':_0x11c82b['body'][_0xa42b('0x80')],'phone':_0x11c82b[_0xa42b('0x49')][_0xa42b('0x80')],'ListId':_0x4e43ae[_0xa42b('0x7f')]});_0x633811[_0x11c82b[_0xa42b('0x49')]['mapKeyOffline']]=_0x11c82b[_0xa42b('0x49')]['from'];return db[_0xa42b('0x91')]['findOrCreate']({'where':_0x1a18c2,'defaults':_0x633811});}})[_0xa42b('0xa9')](function(_0x50683d){if(_0x50683d){_0x52618e=_0x50683d;var _0x53138d=fs[_0xa42b('0xc4')](path[_0xa42b('0x66')](config[_0xa42b('0x67')],_0xa42b('0xc5')),_0xa42b('0xc6'));var _0x19dae6=ejs['render'](_0x53138d,{'body':_[_0xa42b('0xc7')](_0x11c82b['body'][_0xa42b('0x49')]),'bodyTitle':_0x3299f8[_0xa42b('0xc8')]});return db[_0xa42b('0xc9')]['create']({'body':_0x19dae6,'plainBody':htmlToText[_0xa42b('0xca')](_0x19dae6),'ContactId':_0x50683d['id'],'ChatWebsiteId':_0x3299f8['id']});}})[_0xa42b('0x29')](function(_0x58d7b1){_0x465c73=_0x58d7b1;if(_0x2e7c5f[_0xa42b('0x37')]){var _0x5ba11a=_0x2e7c5f[_0xa42b('0x2f')](function(_0x1deb4d){return{'name':_0x1deb4d[_0xa42b('0xcb')],'basename':_0x1deb4d[_0xa42b('0x62')],'type':_0x1deb4d[_0xa42b('0xcc')],'ChatOfflineMessageId':_0x58d7b1['id']};});_0xadad39=_0x5ba11a[_0xa42b('0x2f')](_0x4b4fc0=>{var _0x203d06={'filename':_0x4b4fc0[_0xa42b('0x2a')],'path':path[_0xa42b('0x66')](config['root'],_0xa42b('0xcd'),'files','attachments',_0xa42b('0xce'),_0x4b4fc0['basename'])};return _0x203d06;});if(!_0x3299f8[_0xa42b('0xcf')]){return db[_0xa42b('0xd0')]['transaction'](function(_0x2966b7){return db[_0xa42b('0xd1')]['bulkCreate'](_0x5ba11a,{'transaction':_0x2966b7});});}}})[_0xa42b('0x29')](function(){if(_0x465c73){_0x19da34=_0x465c73;return db[_0xa42b('0xc3')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xa42b('0xd2')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa42b('0xd3')],'as':_0xa42b('0xd3'),'raw':!![]}]}]});}})[_0xa42b('0x29')](function(_0x14e573){if(_0x14e573&&_0x14e573['Smtp']&&_0x3299f8[_0xa42b('0xd4')]&&_0x3299f8['forwardOfflineAddress']){var _0x281986=_0x14e573[_0xa42b('0xd5')]();return respondWithRpcPromise(_0xa42b('0xd6'),_0xa42b('0xd7'),{'account':_0x281986,'message':{'from':util[_0xa42b('0x9d')](_0xa42b('0xd8'),_0x14e573['name'],_0x14e573[_0xa42b('0xd9')]||_0x14e573[_0xa42b('0xda')][_0xa42b('0x4a')]),'to':_0x3299f8['forwardOfflineAddress'],'subject':_0x3299f8['offlineMessageSubject'],'html':_0x19da34[_0xa42b('0x49')],'attachments':_0xadad39}},client9003)['then'](function(){return _0x19da34;})[_0xa42b('0x1b')](function(_0xbae89c){logger[_0xa42b('0x18')](_0xbae89c);});}})[_0xa42b('0x29')](function(){if(_0x3299f8&&_0x3299f8[_0xa42b('0xcf')]&&_0x3299f8[_0xa42b('0xdb')]){var _0x45c4d5=[];if(_0x2e7c5f[_0xa42b('0x37')]){_0x45c4d5=_0x2e7c5f['map'](function(_0x46a09b){return{'name':_0x46a09b[_0xa42b('0xcb')],'basename':_0x46a09b[_0xa42b('0x62')],'type':_0x46a09b[_0xa42b('0xcc')],'ChatOfflineMessageId':_0x465c73['id']};});}var _0x20a458;if(!_[_0xa42b('0x6f')](_0x3299f8['subjectOffline'])){var _0x341d49=_[_0xa42b('0x2f')](_0x11c82b[_0xa42b('0x49')],function(_0x5461b7){return _0x5461b7;});var _0x245e16=_['toPairsIn'](_0x341d49)[0x0];var _0xcfa3ab=_['mapValues'](_0x245e16,function(_0x21c186){return _0x21c186;});_0x20a458=_0xcfa3ab[0x1][_0x3299f8['subjectOffline']];}var _0x1e8cf9={'from':_0x52618e[_0xa42b('0xd9')],'firstName':_0x52618e['firstName'],'lastName':_0x52618e[_0xa42b('0x98')],'mapKey':_0xa42b('0xd9'),'message':{'from':_0x52618e[_0xa42b('0xd9')],'to':_0x3299f8[_0xa42b('0xc3')][_0xa42b('0xd9')],'cc':'','subject':_[_0xa42b('0x6f')](_0x20a458)?_0x3299f8['offlineMessageSubject']:_0x20a458,'messageId':'','sentAt':new Date(),'attach':_0x45c4d5[_0xa42b('0x37')],'attachments':_0x45c4d5,'originChannel':_0xa42b('0xdc'),'ChatWebsiteId':_0x3299f8['id'],'ChatOfflineMessageId':_0x19da34['id'],'originTo':_0x3299f8['MailAccount']['email']},'body':_0x19da34['body']};var _0x2d4ee2={'account':{'id':_0x3299f8['MailAccountId']},'body':_0x1e8cf9,'log':_0xa42b('0xdd')};return respondWithRpcPromise(_0xa42b('0xdd'),_0xa42b('0xde'),_0x2d4ee2,client9001)[_0xa42b('0x29')](function(){return _0x19da34;})[_0xa42b('0x1b')](function(_0x4460e7){logger[_0xa42b('0x18')](_0x4460e7);});}return;})[_0xa42b('0x29')](function(){if(_0x19da34){return _0x19da34;}})[_0xa42b('0x29')](respondWithResult(_0x5570c9,null))[_0xa42b('0x1b')](function(_0x3a341e){logger[_0xa42b('0x18')](_0xa42b('0x1b'),_0x3a341e);for(var _0x19eefb of _0x2e7c5f){var _0x2f2396=path['join'](config[_0xa42b('0x67')],_0xa42b('0xcd'),_0xa42b('0xbd'),'attachments','offline-chat',_0x19eefb[_0xa42b('0x62')]);fs_extra[_0xa42b('0xdf')](_0x2f2396)['catch'](function(_0x5d90dc){logger[_0xa42b('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0x2f2396,_0x5d90dc);});}});};exports[_0xa42b('0xe0')]=function(_0x268215,_0x3f0b52){return db[_0xa42b('0xa5')][_0xa42b('0x4e')]({'where':{'id':_0x268215[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x3f0b52,null))[_0xa42b('0x29')](function(_0x2cffe5){if(_0x2cffe5){return _0x2cffe5[_0xa42b('0xe0')](_0x268215['body'][_0xa42b('0x59')],_[_0xa42b('0xe1')](_0x268215[_0xa42b('0x49')],[_0xa42b('0x59'),'id'])||{});}})[_0xa42b('0x29')](respondWithResult(_0x3f0b52,null))[_0xa42b('0x1b')](handleError(_0x3f0b52,null));};exports[_0xa42b('0xe2')]=function(_0x25ed7e,_0x544015){var _0x1f3308={'raw':![],'where':{}};var _0x2dc3c0={};var _0x54fb74={'count':0x0,'rows':[]};return db[_0xa42b('0x30')][_0xa42b('0x5c')]({'where':{'id':_0x25ed7e[_0xa42b('0x45')]['id']}})['then'](handleEntityNotFound(_0x544015,null))[_0xa42b('0x29')](function(_0x47da31){if(_0x47da31){_0x2dc3c0[_0xa42b('0x34')]=_[_0xa42b('0x46')](db['ChatInteraction']['rawAttributes']);_0x2dc3c0['query']=_['keys'](_0x25ed7e[_0xa42b('0x33')]);_0x2dc3c0[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x2dc3c0[_0xa42b('0x34')],_0x2dc3c0[_0xa42b('0x33')]);_0x1f3308[_0xa42b('0x35')]=_[_0xa42b('0x48')](_0x2dc3c0[_0xa42b('0x34')],qs[_0xa42b('0x36')](_0x25ed7e['query']['fields']));_0x1f3308[_0xa42b('0x35')]=_0x1f3308[_0xa42b('0x35')]['length']?_0x1f3308[_0xa42b('0x35')]:_0x2dc3c0['model'];if(!_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x38')](_0xa42b('0x56'))){_0x1f3308['limit']=qs[_0xa42b('0x21')](_0x25ed7e[_0xa42b('0x33')]['limit']);_0x1f3308[_0xa42b('0x1f')]=qs[_0xa42b('0x1f')](_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x1f')]);}_0x1f3308['order']=qs[_0xa42b('0x39')](_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x39')]);_0x1f3308['where']=qs[_0xa42b('0x3c')](_[_0xa42b('0x3b')](_0x25ed7e[_0xa42b('0x33')],_0x2dc3c0[_0xa42b('0x3c')]));_0x1f3308[_0xa42b('0x3a')]['ChatWebsiteId']=_0x47da31['id'];if(_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x1f3308[_0xa42b('0x3a')]=_['merge'](_0x1f3308[_0xa42b('0x3a')],{'$or':_[_0xa42b('0x2f')](_0x1f3308['attributes'],function(_0x59b79e){var _0x58bf24={};_0x58bf24[_0x59b79e]={'$like':'%'+_0x25ed7e[_0xa42b('0x33')]['filter']+'%'};return _0x58bf24;})});}_0x1f3308=_[_0xa42b('0x3e')]({},_0x1f3308,_0x25ed7e[_0xa42b('0x40')]);return db[_0xa42b('0xa5')][_0xa42b('0x22')]({'where':_0x1f3308[_0xa42b('0x3a')]})[_0xa42b('0x29')](function(_0x5aabe2){_0x54fb74[_0xa42b('0x22')]=_0x5aabe2;if(_0x25ed7e[_0xa42b('0x33')][_0xa42b('0x41')]){_0x1f3308['include']=[{'model':db[_0xa42b('0x91')],'as':_0xa42b('0xe3'),'required':![]},{'model':db[_0xa42b('0xb4')],'as':_0xa42b('0xe4'),'attributes':[_0xa42b('0x2a'),'fullname',_0xa42b('0xe5')],'required':![]},{'model':db[_0xa42b('0xe6')],'as':'Tags','attributes':['id',_0xa42b('0x2a'),_0xa42b('0xe7')],'where':_0x25ed7e['query']['tag']?{'id':_0x25ed7e['query'][_0xa42b('0xe8')]}:undefined,'required':_0x25ed7e[_0xa42b('0x33')][_0xa42b('0xe8')]?!![]:![]}];}return db[_0xa42b('0xa5')]['findAll'](_0x1f3308);})['then'](function(_0x26165b){_0x54fb74[_0xa42b('0x43')]=_0x26165b;return _0x54fb74;});}})[_0xa42b('0x29')](respondWithFilteredResult(_0x544015,_0x1f3308))[_0xa42b('0x1b')](handleError(_0x544015,null));};function iftimePromise(_0x1e112b,_0x36d352){return respondWithRpcPromise(_0xa42b('0xe9'),_0xa42b('0xea'),{'command':_0x36d352[_0xa42b('0xeb')]?util[_0xa42b('0x9d')](_0xa42b('0xec'),_0x1e112b[_0xa42b('0xed')],_0x36d352[_0xa42b('0xeb')]):util[_0xa42b('0x9d')](_0xa42b('0xee'),_0x1e112b[_0xa42b('0xed')])},client9002)['then'](function(_0x2c422e){var _0x58b709=_0x2c422e&&_0x2c422e['indexOf'](_0xa42b('0xef'))>=0x0?!![]:![];logger[_0xa42b('0x13')](_0xa42b('0xf0'),_0x36d352['id'],_0x1e112b['id'],_0x1e112b[_0xa42b('0xed')],_0x58b709?_0xa42b('0xf1'):_0xa42b('0xf2'),_0x36d352[_0xa42b('0xeb')]?_0x36d352[_0xa42b('0xeb')]:_0xa42b('0xf3'));return _0x58b709;})[_0xa42b('0x1b')](function(_0x13ac21){logger['error'](_0xa42b('0xf0'),_0x36d352['id'],_0x1e112b['id'],_0x1e112b[_0xa42b('0xed')],util[_0xa42b('0xf4')](_0x13ac21,{'showHidden':![],'depth':null}),_0x36d352[_0xa42b('0xeb')]?_0x36d352['timezone']:_0xa42b('0xf3'));return![];});}exports[_0xa42b('0xea')]=function(_0x22405c,_0x40279d){var _0xf32098=0x0;var _0x2ed4b0=0x0;var _0x39e331=![];var _0x52bb6e;var _0x465757;return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x22405c[_0xa42b('0x45')]['id']},'include':[{'model':db[_0xa42b('0xf5')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xa42b('0xed')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x40279d,null))['then'](function(_0x1c48b9){if(_0x1c48b9){_0x52bb6e=_0x1c48b9;return _0x1c48b9[_0xa42b('0xf6')]({'raw':!![]});}})['then'](function(_0x34a8b2){if(_0x52bb6e){if(_0x34a8b2){_0x465757=_0x34a8b2;}}return require(_0xa42b('0x69'))[_0xa42b('0x6a')]();})[_0xa42b('0x29')](function(_0x29086c){if(_0x29086c){_0x2ed4b0=_0x29086c['virtual'];_0x39e331=_0x29086c[_0xa42b('0x6b')];}})[_0xa42b('0x29')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xa42b('0x29')](function(_0x591ffb){_0xf32098=_0x591ffb;if(_0x2ed4b0&&_0x591ffb>_0x2ed4b0){return db[_0xa42b('0xf7')][_0xa42b('0x5c')]({'where':{'id':0x1}})[_0xa42b('0x29')](function(_0x325bbc){if(_0x325bbc){_0x325bbc[_0xa42b('0xf8')](_0xa42b('0xf9'));}});}})[_0xa42b('0x29')](function(){if(_0x52bb6e['Interval']&&_0x52bb6e[_0xa42b('0xf5')][_0xa42b('0xfa')]){var _0x2b92dc=[];for(var _0x219e3=0x0;_0x219e3<_0x52bb6e['Interval'][_0xa42b('0xfa')][_0xa42b('0x37')];_0x219e3++){var _0x4b8b16=_0x52bb6e[_0xa42b('0xf5')][_0xa42b('0xfa')][_0x219e3][_0xa42b('0x27')]({'plain':!![]});_0x2b92dc[_0xa42b('0xad')](iftimePromise(_0x4b8b16,_0x52bb6e));}return BPromise[_0xa42b('0xfb')](_0x2b92dc)[_0xa42b('0x29')](function(_0x4e2db3){return _['some'](_0x4e2db3);});}else{return!![];}})[_0xa42b('0x29')](function(_0xf82047){var _0x5c12ea=fs[_0xa42b('0xc4')](path['join'](config[_0xa42b('0x67')],'server/files/chat/iframe.ejs'),'utf8');var _0x310510=new url[(_0xa42b('0xfc'))](_0x52bb6e[_0xa42b('0xfd')])[_0xa42b('0xfe')];var _0x921762=_0xa42b('0xff');var _0x5b794e=![];var _0x108d40={'chatVersion':_0x921762,'chatWebsiteAddressOrigin':_0x310510,'remote':_0x52bb6e[_0xa42b('0x100')],'query':querystring[_0xa42b('0x17')](_[_0xa42b('0x3e')](_0x52bb6e[_0xa42b('0x27')]({'plain':!![]}),{'customerIp':_0x22405c[_0xa42b('0x77')]['x-forwarded-for']||_0x22405c[_0xa42b('0x77')][_0xa42b('0x101')]||_0x22405c['connection'][_0xa42b('0x102')]||_0x22405c['ip'],'referer':_0x22405c[_0xa42b('0x77')][_0xa42b('0x9a')],'openedInteractions':_0xf32098,'maxInteractions':_0x2ed4b0,'virtual':_0x39e331[_0xa42b('0x103')],'online':_0xf82047,'custom':_0x39e331}))[_0xa42b('0x104')](/'/g,'\x5c\x27')};_0x40279d['send'](ejs[_0xa42b('0x105')](Mustache[_0xa42b('0x105')](_0x5c12ea,_0x108d40),{'proactiveActions':_0x465757,'alignment':_0x52bb6e[_0xa42b('0x106')],'verticalAlignment':_0x52bb6e[_0xa42b('0x107')],'div_color':_0x52bb6e[_0xa42b('0xe7')],'labelText':_0x52bb6e[_0xa42b('0x108')],'text_color':_0x52bb6e[_0xa42b('0x109')],'text_button_color':_0x52bb6e[_0xa42b('0x10a')],'button_color':_0x52bb6e[_0xa42b('0x10b')],'background_color':_0x52bb6e['backgroundColor'],'hideWhenOffline':_0x52bb6e[_0xa42b('0x10c')],'intervalId':_0x52bb6e['IntervalId'],'isDevelopment':_0x5b794e,'chatVersion':_0x921762}));})[_0xa42b('0x1b')](handleError(_0x40279d,null));};exports[_0xa42b('0x10d')]=function(_0x375b77,_0x56e8e1){var _0xaf6578=_0x375b77[_0xa42b('0x45')]['id'];var _0x73efd0=_0x375b77[_0xa42b('0x49')];var _0x20df5c=0xc8;var _0x3c9e2c=null;return db[_0xa42b('0xd0')][_0xa42b('0x10e')]({'isolationLevel':db[_0xa42b('0xd0')][_0xa42b('0x10f')][_0xa42b('0x110')][_0xa42b('0x111')]},function(_0x54709e){return db['ChatWebsite'][_0xa42b('0x5c')]({'where':{'id':_0xaf6578},'transaction':_0x54709e})['then'](function(_0x277c86){if(_0x277c86){return db[_0xa42b('0x8a')][_0xa42b('0x26')]({'where':{'ChatWebsiteId':_0xaf6578},'transaction':_0x54709e})[_0xa42b('0x29')](function(){var _0x28a150=_[_0xa42b('0x2f')](_0x73efd0,function(_0x1e02a7){_0x1e02a7['ChatWebsiteId']=_0xaf6578;return _0x1e02a7;});return db['ChatApplication']['bulkCreate'](_0x28a150,{'transaction':_0x54709e});});}else{_0x20df5c=0x194;_0x3c9e2c=[];}});})[_0xa42b('0x29')](function(){if(_0x20df5c!==0x194){return db[_0xa42b('0x8a')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xaf6578},'order':_0xa42b('0x8f')})[_0xa42b('0x29')](function(_0x146f9b){_0x3c9e2c=_0x146f9b;});}})[_0xa42b('0x1b')](function(_0x1e1223){_0x20df5c=0x1f4;logger['error'](_0x1e1223[_0xa42b('0x112')]);if(_0x1e1223[_0xa42b('0x2a')]){delete _0x1e1223['name'];}_0x3c9e2c=_0x1e1223;})['finally'](function(){if(_0x3c9e2c===null){_0x56e8e1[_0xa42b('0x1c')](_0x20df5c);}else{if(_0x20df5c===0x1f4){_0x56e8e1[_0xa42b('0x23')](_0x20df5c)[_0xa42b('0x2b')](_0x3c9e2c);}else{_0x56e8e1[_0xa42b('0x23')](_0x20df5c)[_0xa42b('0x1e')](_0x3c9e2c);}}});};exports['getApplications']=function(_0x36b220,_0x3458c0){var _0x39a2f2={};var _0x3b2482={};var _0x3fa958;var _0x5379b4;return db[_0xa42b('0x30')]['findOne']({'where':{'id':_0x36b220[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x3458c0,null))[_0xa42b('0x29')](function(_0x392831){if(_0x392831){_0x3fa958=_0x392831;_0x3b2482[_0xa42b('0x34')]=_['keys'](db[_0xa42b('0x8a')][_0xa42b('0x47')]);_0x3b2482[_0xa42b('0x33')]=_[_0xa42b('0x46')](_0x36b220[_0xa42b('0x33')]);_0x3b2482[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x3b2482[_0xa42b('0x34')],_0x3b2482[_0xa42b('0x33')]);_0x39a2f2['attributes']=_[_0xa42b('0x48')](_0x3b2482[_0xa42b('0x34')],qs[_0xa42b('0x36')](_0x36b220[_0xa42b('0x33')][_0xa42b('0x36')]));_0x39a2f2['attributes']=_0x39a2f2['attributes'][_0xa42b('0x37')]?_0x39a2f2[_0xa42b('0x35')]:_0x3b2482['model'];_0x39a2f2[_0xa42b('0x57')]=qs['sort'](_0x36b220[_0xa42b('0x33')][_0xa42b('0x39')]);_0x39a2f2[_0xa42b('0x3a')]=qs['filters'](_[_0xa42b('0x3b')](_0x36b220[_0xa42b('0x33')],_0x3b2482[_0xa42b('0x3c')]));if(_0x36b220[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x39a2f2['where']=_[_0xa42b('0x3e')](_0x39a2f2[_0xa42b('0x3a')],{'$or':_[_0xa42b('0x2f')](_0x39a2f2['attributes'],function(_0x494074){var _0x14527f={};_0x14527f[_0x494074]={'$like':'%'+_0x36b220[_0xa42b('0x33')][_0xa42b('0x3d')]+'%'};return _0x14527f;})});}_0x39a2f2=_['merge']({},_0x39a2f2,_0x36b220[_0xa42b('0x40')]);return _0x3fa958['getApplications'](_0x39a2f2);}})['then'](function(_0x3ba503){if(_0x3ba503){_0x5379b4=_0x3ba503[_0xa42b('0x37')];if(!_0x36b220[_0xa42b('0x33')][_0xa42b('0x38')]('nolimit')){_0x39a2f2[_0xa42b('0x21')]=qs['limit'](_0x36b220[_0xa42b('0x33')][_0xa42b('0x21')]);_0x39a2f2[_0xa42b('0x1f')]=qs['offset'](_0x36b220[_0xa42b('0x33')][_0xa42b('0x1f')]);}return _0x3fa958['getApplications'](_0x39a2f2);}})[_0xa42b('0x29')](function(_0x354e7a){if(_0x354e7a){return _0x354e7a?{'count':_0x5379b4,'rows':_0x354e7a}:null;}})[_0xa42b('0x29')](respondWithResult(_0x3458c0,null))[_0xa42b('0x1b')](handleError(_0x3458c0,null));};exports[_0xa42b('0x113')]=function(_0x339af8,_0xe3c5fe){return db['chatProactiveAction'][_0xa42b('0x4e')]({'where':{'id':_0x339af8[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0xe3c5fe,null))[_0xa42b('0x29')](function(_0x198c74){if(_0x198c74){return _0x198c74['addProactiveActions'](_0x339af8[_0xa42b('0x49')][_0xa42b('0x59')],_[_0xa42b('0xe1')](_0x339af8[_0xa42b('0x49')],[_0xa42b('0x59'),'id'])||{});}})[_0xa42b('0x29')](respondWithResult(_0xe3c5fe,null))[_0xa42b('0x1b')](handleError(_0xe3c5fe,null));};exports[_0xa42b('0xf6')]=function(_0x6f0045,_0x40ae9b){var _0x35b466={};var _0x42fd78={};var _0x2d0b22;var _0x178353;return db[_0xa42b('0x30')][_0xa42b('0x5c')]({'where':{'id':_0x6f0045[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x40ae9b,null))[_0xa42b('0x29')](function(_0x16e8a0){if(_0x16e8a0){_0x2d0b22=_0x16e8a0;_0x42fd78[_0xa42b('0x34')]=_[_0xa42b('0x46')](db[_0xa42b('0x114')]['rawAttributes']);_0x42fd78['query']=_[_0xa42b('0x46')](_0x6f0045[_0xa42b('0x33')]);_0x42fd78[_0xa42b('0x3c')]=_[_0xa42b('0x48')](_0x42fd78['model'],_0x42fd78[_0xa42b('0x33')]);_0x35b466[_0xa42b('0x35')]=_[_0xa42b('0x48')](_0x42fd78[_0xa42b('0x34')],qs['fields'](_0x6f0045[_0xa42b('0x33')][_0xa42b('0x36')]));_0x35b466['attributes']=_0x35b466['attributes'][_0xa42b('0x37')]?_0x35b466[_0xa42b('0x35')]:_0x42fd78[_0xa42b('0x34')];_0x35b466[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x6f0045[_0xa42b('0x33')]['sort']);_0x35b466['where']=qs['filters'](_[_0xa42b('0x3b')](_0x6f0045[_0xa42b('0x33')],_0x42fd78[_0xa42b('0x3c')]));if(_0x6f0045[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x35b466[_0xa42b('0x3a')]=_[_0xa42b('0x3e')](_0x35b466['where'],{'$or':_['map'](_0x35b466[_0xa42b('0x35')],function(_0x55e5df){var _0x3f5d39={};_0x3f5d39[_0x55e5df]={'$like':'%'+_0x6f0045[_0xa42b('0x33')][_0xa42b('0x3d')]+'%'};return _0x3f5d39;})});}_0x35b466=_[_0xa42b('0x3e')]({},_0x35b466,_0x6f0045[_0xa42b('0x40')]);return _0x2d0b22[_0xa42b('0xf6')](_0x35b466);}})[_0xa42b('0x29')](function(_0x271f90){if(_0x271f90){_0x178353=_0x271f90[_0xa42b('0x37')];if(!_0x6f0045['query']['hasOwnProperty'](_0xa42b('0x56'))){_0x35b466[_0xa42b('0x21')]=qs[_0xa42b('0x21')](_0x6f0045[_0xa42b('0x33')][_0xa42b('0x21')]);_0x35b466[_0xa42b('0x1f')]=qs[_0xa42b('0x1f')](_0x6f0045[_0xa42b('0x33')]['offset']);}return _0x2d0b22[_0xa42b('0xf6')](_0x35b466);}})['then'](function(_0xe20c5b){if(_0xe20c5b){return _0xe20c5b?{'count':_0x178353,'rows':_0xe20c5b}:null;}})['then'](respondWithResult(_0x40ae9b,null))['catch'](handleError(_0x40ae9b,null));};exports[_0xa42b('0x115')]=function(_0x56938d,_0x2e4343){var _0xbbcbf3=_0x56938d[_0xa42b('0x33')][_0xa42b('0x116')]==='false'?_0xa42b('0x117'):'onlineForm';return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'attributes':['id',_0xbbcbf3],'where':{'id':_0x56938d[_0xa42b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e4343,null))[_0xa42b('0x29')](function(_0x1ca25b){if(_0x1ca25b){var _0x3d97d5=_0x1ca25b[_0xbbcbf3];var _0x5b60ce=_0x3d97d5&&_0x3d97d5['items']?_0x3d97d5[_0xa42b('0x118')]:[];_0x2e4343['send']({'fromKey':_['isNil'](_0x3d97d5[_0xa42b('0x119')])?undefined:_0x3d97d5[_0xa42b('0x119')],'count':_0x5b60ce['length'],'rows':_0x5b60ce});}})[_0xa42b('0x1b')](handleError(_0x2e4343,null));};exports[_0xa42b('0x11a')]=function(_0x5375c8,_0x2686dd){var _0x70e7cc={'raw':![],'where':{}};var _0x54338f={};var _0x4e3cbf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa42b('0x5c')]({'where':{'id':_0x5375c8[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x2686dd,null))['then'](function(_0x5577bb){if(_0x5577bb){_0x54338f[_0xa42b('0x34')]=_[_0xa42b('0x46')](db[_0xa42b('0xc9')][_0xa42b('0x47')]);_0x54338f['query']=_[_0xa42b('0x46')](_0x5375c8[_0xa42b('0x33')]);_0x54338f['filters']=_[_0xa42b('0x48')](_0x54338f['model'],_0x54338f[_0xa42b('0x33')]);_0x70e7cc[_0xa42b('0x35')]=_[_0xa42b('0x48')](_0x54338f[_0xa42b('0x34')],qs[_0xa42b('0x36')](_0x5375c8[_0xa42b('0x33')][_0xa42b('0x36')]));_0x70e7cc['attributes']=_0x70e7cc[_0xa42b('0x35')][_0xa42b('0x37')]?_0x70e7cc[_0xa42b('0x35')]:_0x54338f[_0xa42b('0x34')];if(!_0x5375c8['query'][_0xa42b('0x38')](_0xa42b('0x56'))){_0x70e7cc['limit']=qs[_0xa42b('0x21')](_0x5375c8[_0xa42b('0x33')]['limit']);_0x70e7cc['offset']=qs[_0xa42b('0x1f')](_0x5375c8[_0xa42b('0x33')][_0xa42b('0x1f')]);}_0x70e7cc[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x5375c8['query'][_0xa42b('0x39')]);_0x70e7cc[_0xa42b('0x3a')]=qs[_0xa42b('0x3c')](_[_0xa42b('0x3b')](_0x5375c8['query'],_0x54338f[_0xa42b('0x3c')]));_0x70e7cc[_0xa42b('0x3a')][_0xa42b('0x53')]=_0x5577bb['id'];if(_0x5375c8[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x70e7cc[_0xa42b('0x3a')]=_['merge'](_0x70e7cc[_0xa42b('0x3a')],{'$or':_[_0xa42b('0x2f')](_0x70e7cc[_0xa42b('0x35')],function(_0x10f033){var _0x5991d0={};_0x5991d0[_0x10f033]={'$like':'%'+_0x5375c8[_0xa42b('0x33')][_0xa42b('0x3d')]+'%'};return _0x5991d0;})});}_0x70e7cc=_[_0xa42b('0x3e')]({},_0x70e7cc,_0x5375c8['options']);return db[_0xa42b('0xc9')][_0xa42b('0x22')]({'where':_0x70e7cc['where']})[_0xa42b('0x29')](function(_0x174a7d){_0x4e3cbf[_0xa42b('0x22')]=_0x174a7d;if(_0x5375c8[_0xa42b('0x33')][_0xa42b('0x41')]){_0x70e7cc[_0xa42b('0x5d')]=[{'all':!![]}];}else{_0x70e7cc[_0xa42b('0x5d')]=[{'model':db[_0xa42b('0x91')],'as':_0xa42b('0xe3'),'required':![]},{'model':db[_0xa42b('0xd1')],'as':_0xa42b('0x11b'),'required':![]}];}return db[_0xa42b('0xc9')][_0xa42b('0x42')](_0x70e7cc);})[_0xa42b('0x29')](function(_0x52cded){_0x4e3cbf['rows']=_0x52cded;return _0x4e3cbf;});}})[_0xa42b('0x29')](respondWithFilteredResult(_0x2686dd,_0x70e7cc))[_0xa42b('0x1b')](handleError(_0x2686dd,null));};exports[_0xa42b('0x11c')]=function(_0x500b3d,_0x2f42a2){return db['ChatWebsite'][_0xa42b('0x4e')]({'where':{'id':_0x500b3d[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x2f42a2,null))[_0xa42b('0x29')](function(_0x5e361d){if(_0x5e361d){return _0x5e361d[_0xa42b('0x11c')](_0x500b3d[_0xa42b('0x49')]['ids'],_[_0xa42b('0xe1')](_0x500b3d[_0xa42b('0x49')],[_0xa42b('0x59'),'id'])||{})[_0xa42b('0xa9')](function(_0x4f28a9){for(var _0x56aabe=0x0;_0x56aabe<_0x500b3d[_0xa42b('0x49')][_0xa42b('0x59')]['length'];_0x56aabe+=0x1){socket[_0xa42b('0x11d')](_0xa42b('0x11e'),{'UserId':Number(_0x500b3d[_0xa42b('0x49')]['ids'][_0x56aabe]),'ChatWebsiteId':Number(_0x500b3d[_0xa42b('0x45')]['id'])});}return _0x4f28a9;});}})['then'](respondWithResult(_0x2f42a2,null))['catch'](handleError(_0x2f42a2,null));};exports[_0xa42b('0x11f')]=function(_0x1efecd,_0x528318){return db[_0xa42b('0x30')][_0xa42b('0x4e')]({'where':{'id':_0x1efecd[_0xa42b('0x45')]['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x528318,null))[_0xa42b('0x29')](function(_0x502131){if(_0x502131){return _0x502131['removeAgents'](_0x1efecd['query'][_0xa42b('0x59')])[_0xa42b('0x29')](function(){if(_[_0xa42b('0x120')](_0x1efecd[_0xa42b('0x33')][_0xa42b('0x59')])){for(var _0x32ebf=0x0;_0x32ebf<_0x1efecd[_0xa42b('0x33')]['ids'][_0xa42b('0x37')];_0x32ebf+=0x1){socket[_0xa42b('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x1efecd[_0xa42b('0x33')][_0xa42b('0x59')][_0x32ebf]),'ChatWebsiteId':Number(_0x1efecd[_0xa42b('0x45')]['id'])});}}else{socket[_0xa42b('0x11d')](_0xa42b('0x121'),{'UserId':Number(_0x1efecd['query'][_0xa42b('0x59')]),'ChatWebsiteId':Number(_0x1efecd[_0xa42b('0x45')]['id'])});}});}})[_0xa42b('0x29')](respondWithStatusCode(_0x528318,null))['catch'](handleError(_0x528318,null));};exports[_0xa42b('0x122')]=function(_0x3fa1f4,_0x5bdfb6){var _0x2afa44={};var _0x447d39={};var _0x21331c;var _0x557c32;return db['ChatWebsite'][_0xa42b('0x5c')]({'where':{'id':_0x3fa1f4['params']['id']}})[_0xa42b('0x29')](handleEntityNotFound(_0x5bdfb6,null))[_0xa42b('0x29')](function(_0x3ed4d5){if(_0x3ed4d5){_0x21331c=_0x3ed4d5;_0x447d39[_0xa42b('0x34')]=_[_0xa42b('0x46')](db['User'][_0xa42b('0x47')]);_0x447d39[_0xa42b('0x33')]=_[_0xa42b('0x46')](_0x3fa1f4['query']);_0x447d39[_0xa42b('0x3c')]=_['intersection'](_0x447d39[_0xa42b('0x34')],_0x447d39['query']);_0x2afa44[_0xa42b('0x35')]=_[_0xa42b('0x48')](_0x447d39[_0xa42b('0x34')],qs[_0xa42b('0x36')](_0x3fa1f4['query'][_0xa42b('0x36')]));_0x2afa44[_0xa42b('0x35')]=_0x2afa44[_0xa42b('0x35')][_0xa42b('0x37')]?_0x2afa44[_0xa42b('0x35')]:_0x447d39[_0xa42b('0x34')];_0x2afa44[_0xa42b('0x57')]=qs[_0xa42b('0x39')](_0x3fa1f4['query'][_0xa42b('0x39')]);_0x2afa44['where']=qs['filters'](_[_0xa42b('0x3b')](_0x3fa1f4[_0xa42b('0x33')],_0x447d39[_0xa42b('0x3c')]));if(_0x3fa1f4[_0xa42b('0x33')][_0xa42b('0x3d')]){_0x2afa44['where']=_['merge'](_0x2afa44[_0xa42b('0x3a')],{'$or':_['map'](_0x2afa44['attributes'],function(_0x5adbfc){var _0x46076b={};_0x46076b[_0x5adbfc]={'$like':'%'+_0x3fa1f4['query'][_0xa42b('0x3d')]+'%'};return _0x46076b;})});}_0x2afa44=_[_0xa42b('0x3e')]({},_0x2afa44,_0x3fa1f4[_0xa42b('0x40')]);return _0x21331c[_0xa42b('0x122')](_0x2afa44);}})[_0xa42b('0x29')](function(_0x2c9212){if(_0x2c9212){_0x557c32=_0x2c9212[_0xa42b('0x37')];if(!_0x3fa1f4[_0xa42b('0x33')]['hasOwnProperty'](_0xa42b('0x56'))){_0x2afa44[_0xa42b('0x21')]=qs[_0xa42b('0x21')](_0x3fa1f4[_0xa42b('0x33')]['limit']);_0x2afa44[_0xa42b('0x1f')]=qs[_0xa42b('0x1f')](_0x3fa1f4[_0xa42b('0x33')][_0xa42b('0x1f')]);}return _0x21331c[_0xa42b('0x122')](_0x2afa44);}})['then'](function(_0x3c30e7){if(_0x3c30e7){return _0x3c30e7?{'count':_0x557c32,'rows':_0x3c30e7}:null;}})['then'](respondWithResult(_0x5bdfb6,null))[_0xa42b('0x1b')](handleError(_0x5bdfb6,null));};
\ No newline at end of file
+var _0xb6c2=['CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','ChatApplication','Applications','account','applications','orderBy','priority','asc','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','unmanaged','ChatMessage','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','fromString','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','MailAccountId','subjectOffline','toPairsIn','email','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','URL','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','offlineForm','onlineForm','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','UserProfileResource','name','send','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','length','create','body','user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','find','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','user-agent-parser','setUA','getResult','chat','no\x20available\x20attributes','createdAt','updatedAt','difference'];(function(_0x2228b8,_0x2a73c5){var _0x3fc754=function(_0x246d01){while(--_0x246d01){_0x2228b8['push'](_0x2228b8['shift']());}};_0x3fc754(++_0x2a73c5);}(_0xb6c2,0xa5));var _0x2b6c=function(_0x59c884,_0x3cc95a){_0x59c884=_0x59c884-0x0;var _0x291b1e=_0xb6c2[_0x59c884];return _0x291b1e;};'use strict';var BPromise=require(_0x2b6c('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0x2b6c('0x1'));var fs=require('fs');var fs_extra=require(_0x2b6c('0x2'));var _=require(_0x2b6c('0x3'));var querystring=require(_0x2b6c('0x4'));var Redis=require(_0x2b6c('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x2b6c('0x6'))(_0x2b6c('0x7'));var config=require(_0x2b6c('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2b6c('0x9')](config[_0x2b6c('0xa')],{'host':_0x2b6c('0xb'),'port':0x18eb});var socket=require(_0x2b6c('0xc'))(new Redis(config['redis']));require(_0x2b6c('0xd'))[_0x2b6c('0xe')](socket);var htmlToText=require(_0x2b6c('0xf'));var jayson=require(_0x2b6c('0x10'));var client=jayson[_0x2b6c('0x11')]['http']({'port':0x232c});var client9002=jayson[_0x2b6c('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x2b6c('0x11')][_0x2b6c('0x12')]({'port':0x232b});var client9001=jayson[_0x2b6c('0x11')][_0x2b6c('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x584ddd,_0x2af14d,_0x2f5c4a,_0x801b8a){return new BPromise(function(_0x4b1b55,_0x2e04b2){var _0x2a498e=_0x801b8a||client;return _0x2a498e['request'](_0x584ddd,_0x2f5c4a)[_0x2b6c('0x13')](function(_0x140fcb){logger[_0x2b6c('0x14')](_0x2b6c('0x15'),_0x2af14d,'request\x20sent');logger[_0x2b6c('0x16')](_0x2b6c('0x17'),_0x2af14d,_0x2b6c('0x18'),JSON['stringify'](_0x140fcb));if(_0x140fcb['error']){if(_0x140fcb[_0x2b6c('0x19')]['code']===0x1f4){logger[_0x2b6c('0x19')](_0x2b6c('0x15'),_0x2af14d,_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);return _0x2e04b2(_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);}logger['error'](_0x2b6c('0x15'),_0x2af14d,_0x140fcb['error'][_0x2b6c('0x1a')]);return _0x4b1b55(_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2af14d,_0x2b6c('0x18'));_0x4b1b55(_0x140fcb[_0x2b6c('0x1b')][_0x2b6c('0x1a')]);}})['catch'](function(_0x41317b){logger[_0x2b6c('0x19')](_0x2b6c('0x15'),_0x2af14d,_0x41317b);_0x2e04b2(_0x41317b);});});}function respondWithStatusCode(_0x41b9b3,_0x24d957){_0x24d957=_0x24d957||0xcc;return function(_0x27c11a){if(_0x27c11a){return _0x41b9b3[_0x2b6c('0x1c')](_0x24d957);}return _0x41b9b3[_0x2b6c('0x1d')](_0x24d957)[_0x2b6c('0x1e')]();};}function respondWithResult(_0x5b0f3b,_0x474d76){_0x474d76=_0x474d76||0xc8;return function(_0x176f97){if(_0x176f97){return _0x5b0f3b[_0x2b6c('0x1d')](_0x474d76)['json'](_0x176f97);}};}function respondWithFilteredResult(_0x3cc6a3,_0x5c7e30){return function(_0x58aa80){if(_0x58aa80){var _0x543182=typeof _0x5c7e30[_0x2b6c('0x1f')]===_0x2b6c('0x20')&&typeof _0x5c7e30[_0x2b6c('0x21')]===_0x2b6c('0x20');var _0x33e16f=_0x58aa80[_0x2b6c('0x22')];var _0x40c7c5=_0x543182?0x0:_0x5c7e30[_0x2b6c('0x1f')];var _0x2a3084=_0x543182?_0x58aa80[_0x2b6c('0x22')]:_0x5c7e30[_0x2b6c('0x1f')]+_0x5c7e30[_0x2b6c('0x21')];var _0x13cf47;if(_0x2a3084>=_0x33e16f){_0x2a3084=_0x33e16f;_0x13cf47=0xc8;}else{_0x13cf47=0xce;}_0x3cc6a3[_0x2b6c('0x1d')](_0x13cf47);return _0x3cc6a3[_0x2b6c('0x23')](_0x2b6c('0x24'),_0x40c7c5+'-'+_0x2a3084+'/'+_0x33e16f)[_0x2b6c('0x25')](_0x58aa80);}return null;};}function saveUpdates(_0x1de723){return function(_0xb6045c){if(_0xb6045c){return _0xb6045c[_0x2b6c('0x26')](_0x1de723)['then'](function(_0xb4153e){return _0xb4153e;});}return null;};}function removeEntity(_0x37e7b){return function(_0x96346){if(_0x96346){return _0x96346[_0x2b6c('0x27')]()[_0x2b6c('0x13')](function(){var _0x2c9ced=_0x96346[_0x2b6c('0x28')]({'plain':!![]});var _0x44bb48='ChatWebsites';return db[_0x2b6c('0x29')][_0x2b6c('0x27')]({'where':{'type':_0x44bb48,'resourceId':_0x2c9ced['id']}})[_0x2b6c('0x13')](function(){return _0x96346;});})['then'](function(){_0x37e7b[_0x2b6c('0x1d')](0xcc)[_0x2b6c('0x1e')]();});}};}function handleEntityNotFound(_0x21834a){return function(_0x341d01){if(!_0x341d01){_0x21834a[_0x2b6c('0x1c')](0x194);}return _0x341d01;};}function handleError(_0x287166,_0x27af91){_0x27af91=_0x27af91||0x1f4;return function(_0x3e6039){logger[_0x2b6c('0x19')](_0x3e6039['stack']);if(_0x3e6039[_0x2b6c('0x2a')]){delete _0x3e6039[_0x2b6c('0x2a')];}_0x287166['status'](_0x27af91)[_0x2b6c('0x2b')](_0x3e6039);};}exports['index']=function(_0x35b5f,_0xc2a02c){var _0x54ac13={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x347054={},_0x3a6bea={'count':0x0,'rows':[]};var _0xf70e79=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x3b3561){return{'name':_0x3b3561[_0x2b6c('0x2c')],'type':_0x3b3561['type'][_0x2b6c('0x2d')]};});_0x347054[_0x2b6c('0x2e')]=_[_0x2b6c('0x2f')](_0xf70e79,_0x2b6c('0x2a'));_0x347054[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x35b5f['query']);_0x347054[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x347054[_0x2b6c('0x2e')],_0x347054[_0x2b6c('0x30')]);_0x54ac13[_0x2b6c('0x34')]=_['intersection'](_0x347054[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x54ac13[_0x2b6c('0x34')]=_0x54ac13[_0x2b6c('0x34')]['length']?_0x54ac13[_0x2b6c('0x34')]:_0x347054[_0x2b6c('0x2e')];if(!_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x36')](_0x2b6c('0x37'))){_0x54ac13[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x35b5f['query'][_0x2b6c('0x21')]);_0x54ac13['offset']=qs[_0x2b6c('0x1f')](_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x54ac13[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x35b5f['query'][_0x2b6c('0x39')]);_0x54ac13[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x35b5f[_0x2b6c('0x30')],_0x347054[_0x2b6c('0x32')]),_0xf70e79);if(_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x54ac13[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x54ac13[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0xf70e79,function(_0x78aba0){if(_0x78aba0[_0x2b6c('0x3e')]!==_0x2b6c('0x3f')){var _0x52e881={};_0x52e881[_0x78aba0[_0x2b6c('0x2a')]]={'$like':'%'+_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x52e881;}})});}_0x54ac13=_[_0x2b6c('0x3d')]({},_0x54ac13,_0x35b5f[_0x2b6c('0x40')]);var _0x475e04={'where':_0x54ac13['where']};return db[_0x2b6c('0x41')][_0x2b6c('0x22')](_0x475e04)[_0x2b6c('0x13')](function(_0x15994c){_0x3a6bea[_0x2b6c('0x22')]=_0x15994c;if(_0x35b5f['query'][_0x2b6c('0x42')]){_0x54ac13[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x41')][_0x2b6c('0x44')](_0x54ac13);})[_0x2b6c('0x13')](function(_0x1f1590){_0x3a6bea[_0x2b6c('0x45')]=_0x1f1590;return _0x3a6bea;})[_0x2b6c('0x13')](respondWithFilteredResult(_0xc2a02c,_0x54ac13))[_0x2b6c('0x46')](handleError(_0xc2a02c,null));};exports[_0x2b6c('0x47')]=function(_0x1b78e6,_0x1d41d4){var _0x4d8487={'raw':![],'where':{'id':_0x1b78e6[_0x2b6c('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0x2b6c('0x49')}]},_0x765b0b={};_0x765b0b[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0x41')]['rawAttributes']);_0x765b0b[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x1b78e6[_0x2b6c('0x30')]);_0x765b0b[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x765b0b[_0x2b6c('0x2e')],_0x765b0b['query']);_0x4d8487[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x765b0b['model'],qs[_0x2b6c('0x35')](_0x1b78e6['query'][_0x2b6c('0x35')]));_0x4d8487[_0x2b6c('0x34')]=_0x4d8487[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x4d8487[_0x2b6c('0x34')]:_0x765b0b[_0x2b6c('0x2e')];if(_0x1b78e6[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x4d8487[_0x2b6c('0x43')]=[{'all':!![]}];}_0x4d8487=_[_0x2b6c('0x3d')]({},_0x4d8487,_0x1b78e6[_0x2b6c('0x40')]);return db['ChatWebsite']['find'](_0x4d8487)['then'](handleEntityNotFound(_0x1d41d4,null))[_0x2b6c('0x13')](respondWithResult(_0x1d41d4,null))[_0x2b6c('0x46')](handleError(_0x1d41d4,null));};exports['create']=function(_0x382a3a,_0x17f104){return db['ChatWebsite'][_0x2b6c('0x4b')](_0x382a3a[_0x2b6c('0x4c')],{})[_0x2b6c('0x13')](function(_0x3573be){var _0xf316ba=_0x382a3a[_0x2b6c('0x4d')][_0x2b6c('0x28')]({'plain':!![]});if(!_0xf316ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf316ba[_0x2b6c('0x4e')]==='user'){var _0x31e734=_0x3573be[_0x2b6c('0x28')]({'plain':!![]});var _0x19e7fd=_0x2b6c('0x4f');return db[_0x2b6c('0x50')]['find']({'where':{'name':_0x19e7fd,'userProfileId':_0xf316ba['userProfileId']},'raw':!![]})[_0x2b6c('0x13')](function(_0x485b1d){if(_0x485b1d&&_0x485b1d[_0x2b6c('0x51')]===0x0){return db[_0x2b6c('0x29')][_0x2b6c('0x4b')]({'name':_0x31e734[_0x2b6c('0x2a')],'resourceId':_0x31e734['id'],'type':_0x485b1d[_0x2b6c('0x2a')],'sectionId':_0x485b1d['id']},{})['then'](function(){return _0x3573be;});}else{return _0x3573be;}})['catch'](function(_0xa1c23b){logger[_0x2b6c('0x19')](_0x2b6c('0x52'),_0xa1c23b);throw _0xa1c23b;});}return _0x3573be;})[_0x2b6c('0x13')](respondWithResult(_0x17f104,0xc9))[_0x2b6c('0x46')](handleError(_0x17f104,null));};exports[_0x2b6c('0x26')]=function(_0x2af718,_0x3aeba6){if(_0x2af718[_0x2b6c('0x4c')]['id']){delete _0x2af718['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2af718[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0x53')],'as':_0x2b6c('0x49')}]})[_0x2b6c('0x13')](handleEntityNotFound(_0x3aeba6,null))[_0x2b6c('0x13')](saveUpdates(_0x2af718[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x3aeba6,null))[_0x2b6c('0x46')](handleError(_0x3aeba6,null));};exports[_0x2b6c('0x27')]=function(_0xa0af8e,_0x5861e9){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0xa0af8e[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x5861e9,null))['then'](removeEntity(_0x5861e9,null))[_0x2b6c('0x46')](handleError(_0x5861e9,null));};exports[_0x2b6c('0x54')]=function(_0x44847e,_0xd23f2e){return db[_0x2b6c('0x41')][_0x2b6c('0x54')]()[_0x2b6c('0x13')](respondWithResult(_0xd23f2e,null))[_0x2b6c('0x46')](handleError(_0xd23f2e,null));};exports[_0x2b6c('0x55')]=function(_0x326ce5,_0x532a1d){if(_0x326ce5['body']['id']){delete _0x326ce5[_0x2b6c('0x4c')]['id'];}return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x326ce5[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x532a1d,null))[_0x2b6c('0x13')](function(_0x239ad1){if(_0x239ad1){_0x326ce5[_0x2b6c('0x4c')][_0x2b6c('0x57')]=_0x239ad1['id'];return db[_0x2b6c('0x58')]['create'](_0x326ce5[_0x2b6c('0x4c')]);}})[_0x2b6c('0x13')](respondWithResult(_0x532a1d,null))[_0x2b6c('0x46')](handleError(_0x532a1d,null));};exports[_0x2b6c('0x59')]=function(_0x2ebf91,_0x243100){var _0x229280={'raw':![],'where':{}};var _0x574b6d={};var _0x203cce={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x2ebf91['params']['id']}})['then'](handleEntityNotFound(_0x243100,null))[_0x2b6c('0x13')](function(_0xf8caf1){if(_0xf8caf1){_0x574b6d['model']=_[_0x2b6c('0x31')](db[_0x2b6c('0x58')]['rawAttributes']);_0x574b6d[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x2ebf91[_0x2b6c('0x30')]);_0x574b6d['filters']=_['intersection'](_0x574b6d[_0x2b6c('0x2e')],_0x574b6d[_0x2b6c('0x30')]);_0x229280['attributes']=_[_0x2b6c('0x33')](_0x574b6d['model'],qs[_0x2b6c('0x35')](_0x2ebf91['query'][_0x2b6c('0x35')]));_0x229280[_0x2b6c('0x34')]=_0x229280['attributes']['length']?_0x229280[_0x2b6c('0x34')]:_0x574b6d[_0x2b6c('0x2e')];if(!_0x2ebf91[_0x2b6c('0x30')]['hasOwnProperty']('nolimit')){_0x229280['limit']=qs[_0x2b6c('0x21')](_0x2ebf91['query'][_0x2b6c('0x21')]);_0x229280['offset']=qs[_0x2b6c('0x1f')](_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x229280['order']=qs['sort'](_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x229280[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x2ebf91[_0x2b6c('0x30')],_0x574b6d[_0x2b6c('0x32')]));_0x229280['where']['ChatWebsiteId']=_0xf8caf1['id'];if(_0x2ebf91['query'][_0x2b6c('0x3c')]){_0x229280[_0x2b6c('0x3a')]=_['merge'](_0x229280[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0x229280[_0x2b6c('0x34')],function(_0x1cfd58){var _0x48d33c={};_0x48d33c[_0x1cfd58]={'$like':'%'+_0x2ebf91['query'][_0x2b6c('0x3c')]+'%'};return _0x48d33c;})});}_0x229280=_['merge']({},_0x229280,_0x2ebf91[_0x2b6c('0x40')]);return db[_0x2b6c('0x58')][_0x2b6c('0x22')]({'where':_0x229280[_0x2b6c('0x3a')]})[_0x2b6c('0x13')](function(_0x157039){_0x203cce[_0x2b6c('0x22')]=_0x157039;if(_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x229280[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x58')][_0x2b6c('0x44')](_0x229280);})[_0x2b6c('0x13')](function(_0x17632c){_0x203cce[_0x2b6c('0x45')]=_0x17632c;return _0x203cce;});}})[_0x2b6c('0x13')](respondWithFilteredResult(_0x243100,_0x229280))[_0x2b6c('0x46')](handleError(_0x243100,null));};exports[_0x2b6c('0x5b')]=function(_0x519a90,_0x50498d){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x519a90['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x50498d,null))['then'](function(_0x24f958){if(_0x24f958){return _0x24f958['removeDispositions'](_0x519a90[_0x2b6c('0x30')][_0x2b6c('0x5c')]);}})['then'](respondWithStatusCode(_0x50498d,null))[_0x2b6c('0x46')](handleError(_0x50498d,null));};exports[_0x2b6c('0x5d')]=function(_0x39a7e1,_0x211e15){if(_0x39a7e1[_0x2b6c('0x4c')]['id']){delete _0x39a7e1[_0x2b6c('0x4c')]['id'];}return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x39a7e1[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x211e15,null))['then'](function(_0x253afd){if(_0x253afd){_0x39a7e1[_0x2b6c('0x4c')]['ChatWebsiteId']=_0x253afd['id'];return db[_0x2b6c('0x5e')][_0x2b6c('0x4b')](_0x39a7e1[_0x2b6c('0x4c')]);}})[_0x2b6c('0x13')](respondWithResult(_0x211e15,null))['catch'](handleError(_0x211e15,null));};exports[_0x2b6c('0x5f')]=function(_0x103a6b,_0x26244b){var _0x18a336={'raw':![],'where':{}};var _0x3ef0e9={};var _0x379d4e={'count':0x0,'rows':[]};return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x103a6b[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x26244b,null))[_0x2b6c('0x13')](function(_0x38013f){if(_0x38013f){_0x3ef0e9[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db['CannedAnswer'][_0x2b6c('0x60')]);_0x3ef0e9[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x103a6b['query']);_0x3ef0e9['filters']=_['intersection'](_0x3ef0e9[_0x2b6c('0x2e')],_0x3ef0e9[_0x2b6c('0x30')]);_0x18a336[_0x2b6c('0x34')]=_['intersection'](_0x3ef0e9[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x103a6b['query'][_0x2b6c('0x35')]));_0x18a336[_0x2b6c('0x34')]=_0x18a336[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x18a336[_0x2b6c('0x34')]:_0x3ef0e9[_0x2b6c('0x2e')];if(!_0x103a6b['query'][_0x2b6c('0x36')](_0x2b6c('0x37'))){_0x18a336['limit']=qs[_0x2b6c('0x21')](_0x103a6b['query']['limit']);_0x18a336['offset']=qs[_0x2b6c('0x1f')](_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x18a336[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x103a6b[_0x2b6c('0x30')]['sort']);_0x18a336[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x103a6b[_0x2b6c('0x30')],_0x3ef0e9[_0x2b6c('0x32')]));_0x18a336[_0x2b6c('0x3a')]['ChatWebsiteId']=_0x38013f['id'];if(_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x18a336[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x18a336[_0x2b6c('0x3a')],{'$or':_['map'](_0x18a336['attributes'],function(_0x3a0d1e){var _0x378be8={};_0x378be8[_0x3a0d1e]={'$like':'%'+_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x378be8;})});}_0x18a336=_[_0x2b6c('0x3d')]({},_0x18a336,_0x103a6b[_0x2b6c('0x40')]);return db[_0x2b6c('0x5e')][_0x2b6c('0x22')]({'where':_0x18a336['where']})[_0x2b6c('0x13')](function(_0x1ed353){_0x379d4e[_0x2b6c('0x22')]=_0x1ed353;if(_0x103a6b[_0x2b6c('0x30')]['includeAll']){_0x18a336[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x5e')][_0x2b6c('0x44')](_0x18a336);})['then'](function(_0x5207e5){_0x379d4e['rows']=_0x5207e5;return _0x379d4e;});}})['then'](respondWithFilteredResult(_0x26244b,_0x18a336))[_0x2b6c('0x46')](handleError(_0x26244b,null));};exports['removeAnswers']=function(_0x2e2141,_0x520423){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x2e2141[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x520423,null))['then'](function(_0x58b375){if(_0x58b375){return _0x58b375['removeAnswers'](_0x2e2141['query'][_0x2b6c('0x5c')]);}})[_0x2b6c('0x13')](respondWithStatusCode(_0x520423,null))[_0x2b6c('0x46')](handleError(_0x520423,null));};exports['addLogo']=function(_0xfc1b07,_0x1d3e1c){_0xfc1b07[_0x2b6c('0x4c')][_0x2b6c('0x61')]=_0xfc1b07[_0x2b6c('0x62')]['filename'];return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0xfc1b07['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x1d3e1c,null))[_0x2b6c('0x13')](saveUpdates(_0xfc1b07[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x1d3e1c,null))['catch'](handleError(_0x1d3e1c,null));};exports[_0x2b6c('0x63')]=function(_0x446f2d,_0x492d1e){_0x446f2d[_0x2b6c('0x4c')][_0x2b6c('0x64')]=_0x446f2d['file'][_0x2b6c('0x65')];return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x446f2d[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x492d1e,null))[_0x2b6c('0x13')](saveUpdates(_0x446f2d['body'],null))['then'](respondWithResult(_0x492d1e,null))[_0x2b6c('0x46')](handleError(_0x492d1e,null));};exports[_0x2b6c('0x66')]=function(_0x4589a8,_0x24e2f2){_0x4589a8[_0x2b6c('0x4c')][_0x2b6c('0x67')]=_0x4589a8[_0x2b6c('0x62')][_0x2b6c('0x65')];return db['ChatWebsite'][_0x2b6c('0x56')]({'where':{'id':_0x4589a8['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x24e2f2,null))[_0x2b6c('0x13')](saveUpdates(_0x4589a8[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x24e2f2,null))[_0x2b6c('0x46')](handleError(_0x24e2f2,null));};exports[_0x2b6c('0x68')]=function(_0x3c4dc6,_0x196a34){_0x3c4dc6[_0x2b6c('0x4c')][_0x2b6c('0x69')]=_0x3c4dc6[_0x2b6c('0x62')][_0x2b6c('0x65')];return db['ChatWebsite'][_0x2b6c('0x56')]({'where':{'id':_0x3c4dc6[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x196a34,null))['then'](saveUpdates(_0x3c4dc6[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x196a34,null))[_0x2b6c('0x46')](handleError(_0x196a34,null));};exports[_0x2b6c('0x6a')]=function(_0xdf72fc,_0x5d198d){var _0x4ce934=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0x6d'));var _0x1db788={'where':{'id':_0xdf72fc[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x61')],'raw':!![]};var _0x59b559=![];return require(_0x2b6c('0x6e'))[_0x2b6c('0x6f')]()[_0x2b6c('0x13')](function(_0x476f05){if(_0x476f05){_0x59b559=_0x476f05[_0x2b6c('0x70')];}})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x1db788);})['then'](handleEntityNotFound(_0x5d198d,null))['then'](function(_0x2a0bcf){if(_0x2a0bcf){if(!_[_0x2b6c('0x71')](_0x2a0bcf[_0x2b6c('0x61')])){if(fs['existsSync'](path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],'server/files/images/logos/',_0x2a0bcf[_0x2b6c('0x61')]))&&_0x59b559){_0x4ce934=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x72'),_0x2a0bcf['sitepic']);}}return _0x5d198d[_0x2b6c('0x73')](_0x4ce934);}})[_0x2b6c('0x46')](handleError(_0x5d198d,null));};exports['getAvatar']=function(_0x312be0,_0x49f0f5){var _0x5b0c68=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x74'));var _0x3aa51f={'where':{'id':_0x312be0[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x64')],'raw':!![]};return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x3aa51f)[_0x2b6c('0x13')](handleEntityNotFound(_0x49f0f5,null))[_0x2b6c('0x13')](function(_0x511045){if(_0x511045){if(!_[_0x2b6c('0x71')](_0x511045['agentAvatar'])){if(fs[_0x2b6c('0x75')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x76'),_0x511045[_0x2b6c('0x64')]))){_0x5b0c68=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x76'),_0x511045[_0x2b6c('0x64')]);}}return _0x49f0f5['download'](_0x5b0c68);}})[_0x2b6c('0x46')](handleError(_0x49f0f5,null));};exports[_0x2b6c('0x77')]=function(_0x5dc3d0,_0x30ccc8){var _0x3d7e7d=path['join'](config[_0x2b6c('0x6c')],_0x2b6c('0x78'));var _0x3365c0={'where':{'id':_0x5dc3d0[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x67'),_0x2b6c('0x79')],'raw':!![]};return db[_0x2b6c('0x41')]['find'](_0x3365c0)[_0x2b6c('0x13')](handleEntityNotFound(_0x30ccc8,null))['then'](function(_0x2a1dbe){if(_0x2a1dbe){if(!_[_0x2b6c('0x71')](_0x2a1dbe[_0x2b6c('0x67')])){if(fs['existsSync'](path['join'](config[_0x2b6c('0x6c')],_0x2b6c('0x76'),_0x2a1dbe[_0x2b6c('0x67')]))&&_0x2a1dbe[_0x2b6c('0x79')]){_0x3d7e7d=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0x76'),_0x2a1dbe[_0x2b6c('0x67')]);}}return _0x30ccc8[_0x2b6c('0x73')](_0x3d7e7d);}})[_0x2b6c('0x46')](handleError(_0x30ccc8,null));};exports['getSystemAvatar']=function(_0x3cf067,_0xd502c0){var _0x417e48=path[_0x2b6c('0x6b')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x474983={'where':{'id':_0x3cf067[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x69')],'raw':!![]};return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x474983)[_0x2b6c('0x13')](handleEntityNotFound(_0xd502c0,null))['then'](function(_0x546919){if(_0x546919){if(!_[_0x2b6c('0x71')](_0x546919[_0x2b6c('0x69')])){if(fs['existsSync'](path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],'server/files/images/avatars/',_0x546919['systemAvatar']))){_0x417e48=path['join'](config[_0x2b6c('0x6c')],'server/files/images/avatars/',_0x546919[_0x2b6c('0x69')]);}}return _0xd502c0[_0x2b6c('0x73')](_0x417e48);}})['catch'](handleError(_0xd502c0,null));};exports[_0x2b6c('0x7a')]=function(_0x4881b6,_0xa3d644){var _0x13b0af=require(_0x2b6c('0x7b'));var _0x157eac=new _0x13b0af();var _0x4e1e91=_0x157eac[_0x2b6c('0x7c')](_0x4881b6['headers']['user-agent'])[_0x2b6c('0x7d')]();var _0x19cfb1={'body':_0x4881b6['body'],'channel':_0x2b6c('0x7e')};var _0x3566fa=[];var _0x265e61=[];var _0x88aa13={};var _0x240164=![];return db['CmContact']['describe']()['then'](function(_0x2bc2de){if(!_0x2bc2de){throw new db['Sequelize']['ValidationError'](_0x2b6c('0x7f'));}_0x3566fa=_['difference'](_[_0x2b6c('0x31')](_0x2bc2de),[_0x2b6c('0x80'),_0x2b6c('0x81')]);_0x265e61=_[_0x2b6c('0x82')](_[_0x2b6c('0x31')](_0x2bc2de),['createdAt',_0x2b6c('0x81'),_0x2b6c('0x83'),_0x2b6c('0x84')]);if(_0x4881b6['body']['id']){delete _0x4881b6[_0x2b6c('0x4c')]['id'];}if(_['isNil'](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x85')])){throw new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))](_0x2b6c('0x88'));}if(_[_0x2b6c('0x71')](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')])||_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')]===''){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x89'));}if(_[_0x2b6c('0x71')](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x8a')])){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x8b')+_0x265e61);}if(!_['includes'](_0x265e61,_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x8a')])){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x8c')+_0x265e61);}_0x88aa13[_0x4881b6['body'][_0x2b6c('0x8a')]]=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x85')];})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0x4881b6[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0x8d')],'as':_0x2b6c('0x8e'),'include':[{'model':db[_0x2b6c('0x8f')],'as':_0x2b6c('0x90'),'where':_0x88aa13,'limit':0x1,'order':[[_0x2b6c('0x81'),'DESC']]}]},{'model':db[_0x2b6c('0x91')],'as':_0x2b6c('0x92')}]});})[_0x2b6c('0x13')](handleEntityNotFound(_0xa3d644,null))['then'](function(_0x56407c){if(_0x56407c&&_0x56407c[_0x2b6c('0x8e')]){_0x19cfb1[_0x2b6c('0x93')]=_0x56407c;_0x19cfb1[_0x2b6c('0x94')]=_0x56407c[_0x2b6c('0x92')];_0x19cfb1['list']=_0x56407c[_0x2b6c('0x8e')];_0x19cfb1[_0x2b6c('0x94')]=_[_0x2b6c('0x95')](_0x19cfb1['applications'],[_0x2b6c('0x96')],[_0x2b6c('0x97')]);if(_0x19cfb1['account'][_0x2b6c('0x92')]){delete _0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0x92')];}if(_0x19cfb1[_0x2b6c('0x93')]['List']&&_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0x8e')][_0x2b6c('0x90')]['length']){return _0x19cfb1[_0x2b6c('0x93')]['List'][_0x2b6c('0x90')][0x0];}var _0x3066a3=_['defaults'](_0x4881b6[_0x2b6c('0x4c')],{'firstName':_0x4881b6['body'][_0x2b6c('0x85')],'ListId':_0x56407c[_0x2b6c('0x84')]});_0x3066a3[_0x4881b6[_0x2b6c('0x4c')]['mapKey']]=_0x4881b6[_0x2b6c('0x4c')]['from'];return db[_0x2b6c('0x8f')][_0x2b6c('0x4b')](_0x3066a3,{'fields':_0x3566fa,'raw':!![]});}})['then'](handleEntityNotFound(_0xa3d644,null))[_0x2b6c('0x13')](function(_0x10fc06){_0x19cfb1[_0x2b6c('0x98')]=_0x10fc06;var _0x1229d1=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x99')];if(_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9b')]){_0x1229d1=_0x4881b6['headers']['cf-connecting-ip'];}else if(_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9c')]){_0x1229d1=_[_0x2b6c('0x9d')](_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9c')][_0x2b6c('0x9e')](','));}if(_0x10fc06){var _0x270a41={'ContactId':_0x10fc06['id'],'ChatWebsiteId':_0x4881b6[_0x2b6c('0x48')]['id'],'from':(_0x10fc06[_0x2b6c('0x9f')]||'')+'\x20'+(_0x10fc06[_0x2b6c('0xa0')]||''),'customerIp':_0x1229d1,'customerPort':_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0xa1')]?_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0xa1')]:null,'referer':_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xa2')],'browserName':_0x4e1e91['browser'][_0x2b6c('0x2a')]&&_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]?util[_0x2b6c('0xa5')](_0x2b6c('0xa6'),_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0x2a')],_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]):_0x2b6c('0xa7'),'browserVersion':_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]||_0x2b6c('0xa7'),'osName':util[_0x2b6c('0xa5')](_0x2b6c('0xa6'),_0x4e1e91['os'][_0x2b6c('0x2a')],_0x4e1e91['os'][_0x2b6c('0xa4')]),'osVersion':_0x4e1e91['os'][_0x2b6c('0xa4')],'deviceModel':_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0x2e')]&&_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0xa9')]?util[_0x2b6c('0xa5')]('%s\x20%s\x20%s',_0x4e1e91['device'][_0x2b6c('0x2e')],_0x4e1e91['device'][_0x2b6c('0xa9')],_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0x3e')]):null,'deviceVendor':_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0xa9')],'deviceType':_0x4e1e91[_0x2b6c('0xa8')]['type'],'formData':JSON[_0x2b6c('0xaa')](_0x4881b6[_0x2b6c('0x4c')])};var _0x250113={'ChatWebsiteId':_0x4881b6['params']['id'],'closed':![]};if(_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]){_0x250113[_0x2b6c('0xab')]=_0x4881b6['body'][_0x2b6c('0xab')];return db[_0x2b6c('0xac')][_0x2b6c('0x56')]({'where':_0x250113})[_0x2b6c('0x13')](function(_0x229b56){if(_0x229b56){return[_0x229b56,![]];}_0x270a41['threadId']=_0x4881b6[_0x2b6c('0x4c')]['threadId'];_0x270a41[_0x2b6c('0xad')]=_0x4881b6['body'][_0x2b6c('0xad')];return db[_0x2b6c('0xac')]['create'](_0x270a41)[_0x2b6c('0x13')](function(_0x3441cb){return[_0x3441cb,!![]];});});}_0x250113[_0x2b6c('0xae')]=_0x10fc06['id'];if(_0x4881b6[_0x2b6c('0x4c')]['interaction']&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xaf')]['id']){_0x250113['id']=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xaf')]['id'];return db[_0x2b6c('0xac')]['find']({'where':_0x250113})[_0x2b6c('0x13')](function(_0x3380a9){if(_0x3380a9){return[_0x3380a9,![]];}return db[_0x2b6c('0xac')][_0x2b6c('0x4b')](_0x270a41)[_0x2b6c('0x13')](function(_0x56fb08){return[_0x56fb08,!![]];});});}return db['ChatInteraction'][_0x2b6c('0x4b')](_0x270a41)['then'](function(_0x403dea){return[_0x403dea,!![]];});}})[_0x2b6c('0xb0')](function(_0xdafa77,_0x4bf470){if(_0xdafa77){_0x240164=_0x4bf470;if(!_0x4bf470){var _0x4479ff={'from':(_0x19cfb1[_0x2b6c('0x98')][_0x2b6c('0x9f')]||'')+'\x20'+(_0x19cfb1['contact'][_0x2b6c('0xa0')]||'')};if(_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xb1')]&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]!=_0x4881b6[_0x2b6c('0x4c')]['messageId']){_0x4479ff[_0x2b6c('0xab')]=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xb1')];}return _0xdafa77[_0x2b6c('0x26')](_0x4479ff);}else{return _0xdafa77;}}})[_0x2b6c('0x13')](function(_0x19aba4){_0x19cfb1['interaction']=_0x19aba4[_0x2b6c('0x28')]({'plain':!![]});_0x19cfb1[_0x2b6c('0xaf')][_0x2b6c('0xb2')]=_0x240164;if(_0x19cfb1['interaction'][_0x2b6c('0xb2')]){if(_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0xb3')]){_0x19cfb1[_0x2b6c('0x94')]['push']({'id':0x0,'priority':_0x19cfb1[_0x2b6c('0x94')]['length']+0x1,'app':'close','appdata':_0x2b6c('0xb4'),'interval':'*,*,*,*'});}}return db[_0x2b6c('0xb5')]['create']({'body':_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')],'ChatWebsiteId':_0x4881b6['params']['id'],'ChatInteractionId':_0x19aba4['id'],'direction':'in','ContactId':_0x19cfb1[_0x2b6c('0x98')]['id'],'AttachmentId':_0x4881b6[_0x2b6c('0x4c')]['AttachmentId']});})[_0x2b6c('0x13')](function(_0x30f36e){_0x19cfb1[_0x2b6c('0x1a')]=_0x30f36e;if(_0x19cfb1['interaction']['UserId']){return db['User'][_0x2b6c('0x56')]({'attributes':['id','name'],'where':{'id':_0x19cfb1[_0x2b6c('0xaf')][_0x2b6c('0xb6')]}})['then'](function(_0x534f98){if(_0x534f98){_0x19cfb1[_0x2b6c('0x94')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2b6c('0xb7'),'appdata':_0x534f98[_0x2b6c('0x2a')]+','+(_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0xb8')]||0xa),'interval':'*,*,*,*'});_0x19cfb1[_0x2b6c('0xb9')]=!![];}return respondWithRpcPromise(_0x2b6c('0xba'),'startRouting',_0x19cfb1);});}return respondWithRpcPromise(_0x2b6c('0xba'),_0x2b6c('0xbb'),_0x19cfb1);})[_0x2b6c('0x13')](function(_0x6cfcb){respondWithRpcPromise(_0x2b6c('0xbc'),_0x2b6c('0xbc'),{'event':'notify','message':_0x6cfcb},client9002);return _0x6cfcb;})[_0x2b6c('0x13')](respondWithResult(_0xa3d644,null))['catch'](handleError(_0xa3d644,null));};exports[_0x2b6c('0xbd')]=function(_0x1f2281,_0x52dbc1){var _0xed2c38,_0x174332,_0x5d8cf0;var _0x4033b2=[];var _0x1731e0={};var _0x17daac=_0x1f2281[_0x2b6c('0xbe')]||[];var _0x26db61=[];var _0x16ef22;return db[_0x2b6c('0x8f')][_0x2b6c('0x54')]()[_0x2b6c('0x13')](function(_0x13b089){if(!_0x13b089){throw new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))](_0x2b6c('0x7f'));}_0x4033b2=_[_0x2b6c('0x82')](_['keys'](_0x13b089),[_0x2b6c('0x80'),_0x2b6c('0x81'),_0x2b6c('0x83'),_0x2b6c('0x84')]);if(_0x1f2281[_0x2b6c('0x4c')]['id']){delete _0x1f2281[_0x2b6c('0x4c')]['id'];}if(_[_0x2b6c('0x71')](_0x1f2281[_0x2b6c('0x4c')]['from'])){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x88')));}if(_['isNil'](_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x4c')])||_0x1f2281[_0x2b6c('0x4c')]['body']===''){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x89')));}if(_[_0x2b6c('0x71')](_0x1f2281[_0x2b6c('0x4c')]['mapKeyOffline'])){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4033b2));}if(!_[_0x2b6c('0xbf')](_0x4033b2,_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0xc0')])){throw _0x52dbc1['status'](0x1f4)['send'](new db[(_0x2b6c('0x86'))]['ValidationError'](_0x2b6c('0xc1')+_0x4033b2));}_0x1731e0[_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0xc0')]]=_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')];})['then'](function(){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x1f2281[_0x2b6c('0x48')]['id']},'include':[{'model':db['CmList'],'as':_0x2b6c('0x8e')},{'model':db[_0x2b6c('0xc2')],'as':_0x2b6c('0xc2')}]});})[_0x2b6c('0x13')](handleEntityNotFound(_0x52dbc1,null))[_0x2b6c('0x13')](function(_0x5df218){if(_0x5df218&&_0x5df218[_0x2b6c('0x8e')]){_0x174332=_0x5df218;var _0x21a82e=_[_0x2b6c('0x9')](_0x1f2281[_0x2b6c('0x4c')],{'firstName':_0x1f2281['body'][_0x2b6c('0x85')],'phone':_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')],'ListId':_0x5df218[_0x2b6c('0x84')]});_0x21a82e[_0x1f2281[_0x2b6c('0x4c')]['mapKeyOffline']]=_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')];return db[_0x2b6c('0x8f')][_0x2b6c('0xc3')]({'where':_0x1731e0,'defaults':_0x21a82e});}})[_0x2b6c('0xb0')](function(_0x5ae640){if(_0x5ae640){_0x5d8cf0=_0x5ae640;var _0x2fd5e9=fs[_0x2b6c('0xc4')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0xc5')),_0x2b6c('0xc6'));var _0x1987be=ejs[_0x2b6c('0xc7')](_0x2fd5e9,{'body':_[_0x2b6c('0xc8')](_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x4c')]),'bodyTitle':_0x174332['offlineMessageBody']});return db['ChatOfflineMessage'][_0x2b6c('0x4b')]({'body':_0x1987be,'plainBody':htmlToText[_0x2b6c('0xc9')](_0x1987be),'ContactId':_0x5ae640['id'],'ChatWebsiteId':_0x174332['id']});}})[_0x2b6c('0x13')](function(_0x190460){_0x16ef22=_0x190460;if(_0x17daac['length']){var _0x4953b2=_0x17daac[_0x2b6c('0x2f')](function(_0x37ba00){return{'name':_0x37ba00[_0x2b6c('0xca')],'basename':_0x37ba00['filename'],'type':_0x37ba00[_0x2b6c('0xcb')],'ChatOfflineMessageId':_0x190460['id']};});_0x26db61=_0x4953b2['map'](_0x28ae85=>{var _0xfb661a={'filename':_0x28ae85['name'],'path':path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0xcc'),_0x2b6c('0xbe'),_0x2b6c('0xcd'),'offline-chat',_0x28ae85[_0x2b6c('0xce')])};return _0xfb661a;});if(!_0x174332[_0x2b6c('0xcf')]){return db[_0x2b6c('0xd0')][_0x2b6c('0xd1')](function(_0xa5812){return db[_0x2b6c('0xd2')][_0x2b6c('0xd3')](_0x4953b2,{'transaction':_0xa5812});});}}})[_0x2b6c('0x13')](function(){if(_0x16ef22){_0xed2c38=_0x16ef22;return db[_0x2b6c('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2b6c('0xd4')],'as':_0x2b6c('0xd5'),'raw':!![],'include':[{'model':db[_0x2b6c('0xd6')],'as':_0x2b6c('0xd6'),'raw':!![]}]}]});}})[_0x2b6c('0x13')](function(_0x402de6){if(_0x402de6&&_0x402de6[_0x2b6c('0xd5')]&&_0x174332[_0x2b6c('0xd7')]&&_0x174332['forwardOfflineAddress']){var _0x1c8dc1=_0x402de6[_0x2b6c('0xd8')]();return respondWithRpcPromise('SendMail',_0x2b6c('0xd9'),{'account':_0x1c8dc1,'message':{'from':util[_0x2b6c('0xa5')](_0x2b6c('0xda'),_0x402de6[_0x2b6c('0x2a')],_0x402de6['email']||_0x402de6[_0x2b6c('0xd5')]['user']),'to':_0x174332[_0x2b6c('0xdb')],'subject':_0x174332['offlineMessageSubject'],'html':_0xed2c38[_0x2b6c('0x4c')],'attachments':_0x26db61}},client9003)[_0x2b6c('0x13')](function(){return _0xed2c38;})['catch'](function(_0x411bb0){logger[_0x2b6c('0x19')](_0x411bb0);});}})[_0x2b6c('0x13')](function(){if(_0x174332&&_0x174332[_0x2b6c('0xcf')]&&_0x174332[_0x2b6c('0xdc')]){var _0x2e5116=[];if(_0x17daac['length']){_0x2e5116=_0x17daac[_0x2b6c('0x2f')](function(_0x10c9bd){return{'name':_0x10c9bd[_0x2b6c('0xca')],'basename':_0x10c9bd['filename'],'type':_0x10c9bd['mimetype'],'ChatOfflineMessageId':_0x16ef22['id']};});}var _0x37f605;if(!_[_0x2b6c('0x71')](_0x174332[_0x2b6c('0xdd')])){var _0x50e425=_[_0x2b6c('0x2f')](_0x1f2281['body'],function(_0x13cc2d){return _0x13cc2d;});var _0x104368=_[_0x2b6c('0xde')](_0x50e425)[0x0];var _0x3bbcfc=_['mapValues'](_0x104368,function(_0x11c415){return _0x11c415;});_0x37f605=_0x3bbcfc[0x1][_0x174332['subjectOffline']];}var _0x3d4c34={'from':_0x5d8cf0[_0x2b6c('0xdf')],'firstName':_0x5d8cf0[_0x2b6c('0x9f')],'lastName':_0x5d8cf0[_0x2b6c('0xa0')],'mapKey':_0x2b6c('0xdf'),'message':{'from':_0x5d8cf0[_0x2b6c('0xdf')],'to':_0x174332[_0x2b6c('0xc2')]['email'],'cc':'','subject':_[_0x2b6c('0x71')](_0x37f605)?_0x174332['offlineMessageSubject']:_0x37f605,'messageId':'','sentAt':new Date(),'attach':_0x2e5116[_0x2b6c('0x4a')],'attachments':_0x2e5116,'originChannel':_0x2b6c('0xe0'),'ChatWebsiteId':_0x174332['id'],'ChatOfflineMessageId':_0xed2c38['id'],'originTo':_0x174332[_0x2b6c('0xc2')][_0x2b6c('0xdf')]},'body':_0xed2c38[_0x2b6c('0x4c')]};var _0x37ffca={'account':{'id':_0x174332['MailAccountId']},'body':_0x3d4c34,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x2b6c('0xe1'),_0x2b6c('0xe2'),_0x37ffca,client9001)[_0x2b6c('0x13')](function(){return _0xed2c38;})[_0x2b6c('0x46')](function(_0x5da751){logger[_0x2b6c('0x19')](_0x5da751);});}return;})[_0x2b6c('0x13')](function(){if(_0xed2c38){return _0xed2c38;}})[_0x2b6c('0x13')](respondWithResult(_0x52dbc1,null))['catch'](function(_0xc1e7e7){logger['error'](_0x2b6c('0x46'),_0xc1e7e7);for(var _0x303861 of _0x17daac){var _0x34e9b6=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0xcc'),_0x2b6c('0xbe'),_0x2b6c('0xcd'),_0x2b6c('0xe3'),_0x303861['filename']);fs_extra[_0x2b6c('0xe4')](_0x34e9b6)[_0x2b6c('0x46')](function(_0x25481a){logger[_0x2b6c('0x19')](_0x2b6c('0xe5'),_0x34e9b6,_0x25481a);});}});};exports[_0x2b6c('0xe6')]=function(_0x162150,_0x155993){return db[_0x2b6c('0xac')][_0x2b6c('0x56')]({'where':{'id':_0x162150[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x155993,null))['then'](function(_0x5d1327){if(_0x5d1327){return _0x5d1327[_0x2b6c('0xe6')](_0x162150[_0x2b6c('0x4c')][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x162150['body'],[_0x2b6c('0x5c'),'id'])||{});}})[_0x2b6c('0x13')](respondWithResult(_0x155993,null))['catch'](handleError(_0x155993,null));};exports[_0x2b6c('0xe8')]=function(_0x102268,_0x58a0c6){var _0x12532b={'raw':![],'where':{}};var _0x75e521={};var _0x5dab61={'count':0x0,'rows':[]};return db[_0x2b6c('0x41')]['findOne']({'where':{'id':_0x102268[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x58a0c6,null))[_0x2b6c('0x13')](function(_0x80bfca){if(_0x80bfca){_0x75e521['model']=_[_0x2b6c('0x31')](db[_0x2b6c('0xac')][_0x2b6c('0x60')]);_0x75e521[_0x2b6c('0x30')]=_['keys'](_0x102268['query']);_0x75e521[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x75e521['model'],_0x75e521[_0x2b6c('0x30')]);_0x12532b[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x75e521[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x102268[_0x2b6c('0x30')]['fields']));_0x12532b[_0x2b6c('0x34')]=_0x12532b['attributes'][_0x2b6c('0x4a')]?_0x12532b[_0x2b6c('0x34')]:_0x75e521[_0x2b6c('0x2e')];if(!_0x102268[_0x2b6c('0x30')][_0x2b6c('0x36')]('nolimit')){_0x12532b[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x102268[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x12532b[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x102268[_0x2b6c('0x30')]['offset']);}_0x12532b[_0x2b6c('0x38')]=qs['sort'](_0x102268[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x12532b[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x102268[_0x2b6c('0x30')],_0x75e521['filters']));_0x12532b[_0x2b6c('0x3a')][_0x2b6c('0x57')]=_0x80bfca['id'];if(_0x102268[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x12532b['where']=_[_0x2b6c('0x3d')](_0x12532b['where'],{'$or':_[_0x2b6c('0x2f')](_0x12532b[_0x2b6c('0x34')],function(_0x3a274b){var _0x169b7d={};_0x169b7d[_0x3a274b]={'$like':'%'+_0x102268[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x169b7d;})});}_0x12532b=_[_0x2b6c('0x3d')]({},_0x12532b,_0x102268[_0x2b6c('0x40')]);return db[_0x2b6c('0xac')][_0x2b6c('0x22')]({'where':_0x12532b[_0x2b6c('0x3a')]})['then'](function(_0x1617ed){_0x5dab61['count']=_0x1617ed;if(_0x102268[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x12532b[_0x2b6c('0x43')]=[{'model':db['CmContact'],'as':_0x2b6c('0xe9'),'required':![]},{'model':db[_0x2b6c('0xea')],'as':_0x2b6c('0xeb'),'attributes':['name',_0x2b6c('0xec'),'internal'],'required':![]},{'model':db[_0x2b6c('0xed')],'as':_0x2b6c('0xee'),'attributes':['id',_0x2b6c('0x2a'),'color'],'where':_0x102268[_0x2b6c('0x30')][_0x2b6c('0xef')]?{'id':_0x102268[_0x2b6c('0x30')]['tag']}:undefined,'required':_0x102268[_0x2b6c('0x30')][_0x2b6c('0xef')]?!![]:![]}];}return db[_0x2b6c('0xac')][_0x2b6c('0x44')](_0x12532b);})[_0x2b6c('0x13')](function(_0x1effbc){_0x5dab61[_0x2b6c('0x45')]=_0x1effbc;return _0x5dab61;});}})['then'](respondWithFilteredResult(_0x58a0c6,_0x12532b))[_0x2b6c('0x46')](handleError(_0x58a0c6,null));};function iftimePromise(_0x5b6701,_0x54490d){return respondWithRpcPromise(_0x2b6c('0xf0'),'getSnippet',{'command':_0x54490d[_0x2b6c('0xf1')]?util[_0x2b6c('0xa5')]('iftime\x20%s,%s',_0x5b6701[_0x2b6c('0xf2')],_0x54490d['timezone']):util[_0x2b6c('0xa5')](_0x2b6c('0xf3'),_0x5b6701['interval'])},client9002)[_0x2b6c('0x13')](function(_0x2f3c8a){var _0x214409=_0x2f3c8a&&_0x2f3c8a[_0x2b6c('0xf4')](_0x2b6c('0xf5'))>=0x0?!![]:![];logger[_0x2b6c('0x14')](_0x2b6c('0xf6'),_0x54490d['id'],_0x5b6701['id'],_0x5b6701['interval'],_0x214409?'ONLINE':'OFFLINE',_0x54490d[_0x2b6c('0xf1')]?_0x54490d[_0x2b6c('0xf1')]:_0x2b6c('0xf7'));return _0x214409;})['catch'](function(_0x46a36c){logger[_0x2b6c('0x19')](_0x2b6c('0xf6'),_0x54490d['id'],_0x5b6701['id'],_0x5b6701[_0x2b6c('0xf2')],util[_0x2b6c('0xf8')](_0x46a36c,{'showHidden':![],'depth':null}),_0x54490d[_0x2b6c('0xf1')]?_0x54490d[_0x2b6c('0xf1')]:_0x2b6c('0xf7'));return![];});}exports[_0x2b6c('0xf9')]=function(_0x8e6594,_0x22626f){var _0x3ad52a=0x0;var _0x12b247=0x0;var _0x335490=![];var _0x3af4c1;var _0x464eea;return db['ChatWebsite']['find']({'where':{'id':_0x8e6594[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0xfa')],'as':_0x2b6c('0xfa'),'include':[{'model':db[_0x2b6c('0xfa')],'as':_0x2b6c('0xfb'),'attributes':['id',_0x2b6c('0xf2')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x22626f,null))[_0x2b6c('0x13')](function(_0x56ff04){if(_0x56ff04){_0x3af4c1=_0x56ff04;return _0x56ff04[_0x2b6c('0xfc')]({'raw':!![]});}})[_0x2b6c('0x13')](function(_0x57c35f){if(_0x3af4c1){if(_0x57c35f){_0x464eea=_0x57c35f;}}return require('../../config/license/util')[_0x2b6c('0x6f')]();})[_0x2b6c('0x13')](function(_0x56c624){if(_0x56c624){_0x12b247=_0x56c624[_0x2b6c('0xfd')];_0x335490=_0x56c624['custom'];}})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0xac')][_0x2b6c('0x22')]({'where':{'closed':![]}});})[_0x2b6c('0x13')](function(_0x55a265){_0x3ad52a=_0x55a265;if(_0x12b247&&_0x55a265>_0x12b247){return db[_0x2b6c('0xfe')][_0x2b6c('0x5a')]({'where':{'id':0x1}})['then'](function(_0x155cf7){if(_0x155cf7){_0x155cf7[_0x2b6c('0xff')](_0x2b6c('0x100'));}});}})[_0x2b6c('0x13')](function(){if(_0x3af4c1['Interval']&&_0x3af4c1['Interval']['Intervals']){var _0x26bcf1=[];for(var _0x520347=0x0;_0x520347<_0x3af4c1['Interval'][_0x2b6c('0xfb')][_0x2b6c('0x4a')];_0x520347++){var _0x2e327c=_0x3af4c1[_0x2b6c('0xfa')][_0x2b6c('0xfb')][_0x520347]['get']({'plain':!![]});_0x26bcf1[_0x2b6c('0x101')](iftimePromise(_0x2e327c,_0x3af4c1));}return BPromise[_0x2b6c('0x102')](_0x26bcf1)['then'](function(_0x3f3f53){return _[_0x2b6c('0x103')](_0x3f3f53);});}else{return!![];}})[_0x2b6c('0x13')](function(_0x105330){var _0x2898fe=fs[_0x2b6c('0xc4')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x104')),'utf8');var _0x142312=new url[(_0x2b6c('0x105'))](_0x3af4c1['address'])[_0x2b6c('0x106')];var _0x28ad7c=_0x2b6c('0x107');var _0x2d959a=![];var _0x4b244c={'chatVersion':_0x28ad7c,'chatWebsiteAddressOrigin':_0x142312,'remote':_0x3af4c1[_0x2b6c('0x108')],'query':querystring[_0x2b6c('0xaa')](_['merge'](_0x3af4c1[_0x2b6c('0x28')]({'plain':!![]}),{'customerIp':_0x8e6594[_0x2b6c('0x9a')][_0x2b6c('0x9c')]||_0x8e6594['headers'][_0x2b6c('0x109')]||_0x8e6594[_0x2b6c('0x10a')][_0x2b6c('0x10b')]||_0x8e6594['ip'],'referer':_0x8e6594['headers']['referer'],'openedInteractions':_0x3ad52a,'maxInteractions':_0x12b247,'virtual':_0x335490[_0x2b6c('0xfd')],'online':_0x105330,'custom':_0x335490}))['replace'](/'/g,'\x5c\x27')};_0x22626f[_0x2b6c('0x2b')](ejs[_0x2b6c('0xc7')](Mustache[_0x2b6c('0xc7')](_0x2898fe,_0x4b244c),{'proactiveActions':_0x464eea,'alignment':_0x3af4c1[_0x2b6c('0x10c')],'verticalAlignment':_0x3af4c1[_0x2b6c('0x10d')],'div_color':_0x3af4c1[_0x2b6c('0x10e')],'labelText':_0x3af4c1[_0x2b6c('0x10f')],'text_color':_0x3af4c1[_0x2b6c('0x110')],'text_button_color':_0x3af4c1[_0x2b6c('0x111')],'button_color':_0x3af4c1['color_button'],'background_color':_0x3af4c1[_0x2b6c('0x112')],'hideWhenOffline':_0x3af4c1['hideWhenOffline'],'intervalId':_0x3af4c1[_0x2b6c('0x113')],'isDevelopment':_0x2d959a,'chatVersion':_0x28ad7c}));})[_0x2b6c('0x46')](handleError(_0x22626f,null));};exports[_0x2b6c('0x114')]=function(_0x71c1cb,_0x52c016){var _0x4291e1=_0x71c1cb['params']['id'];var _0x270c86=_0x71c1cb['body'];var _0x21c7ef=0xc8;var _0x52f0bf=null;return db[_0x2b6c('0xd0')]['transaction']({'isolationLevel':db[_0x2b6c('0xd0')][_0x2b6c('0x115')][_0x2b6c('0x116')][_0x2b6c('0x117')]},function(_0x17e931){return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x4291e1},'transaction':_0x17e931})[_0x2b6c('0x13')](function(_0x4ea0eb){if(_0x4ea0eb){return db[_0x2b6c('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x4291e1},'transaction':_0x17e931})['then'](function(){var _0x87ba1e=_[_0x2b6c('0x2f')](_0x270c86,function(_0x93c6b9){_0x93c6b9[_0x2b6c('0x57')]=_0x4291e1;return _0x93c6b9;});return db['ChatApplication'][_0x2b6c('0xd3')](_0x87ba1e,{'transaction':_0x17e931});});}else{_0x21c7ef=0x194;_0x52f0bf=[];}});})[_0x2b6c('0x13')](function(){if(_0x21c7ef!==0x194){return db[_0x2b6c('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4291e1},'order':_0x2b6c('0x96')})[_0x2b6c('0x13')](function(_0x195a75){_0x52f0bf=_0x195a75;});}})['catch'](function(_0x177a6b){_0x21c7ef=0x1f4;logger[_0x2b6c('0x19')](_0x177a6b[_0x2b6c('0x118')]);if(_0x177a6b['name']){delete _0x177a6b['name'];}_0x52f0bf=_0x177a6b;})['finally'](function(){if(_0x52f0bf===null){_0x52c016[_0x2b6c('0x1c')](_0x21c7ef);}else{if(_0x21c7ef===0x1f4){_0x52c016[_0x2b6c('0x1d')](_0x21c7ef)[_0x2b6c('0x2b')](_0x52f0bf);}else{_0x52c016[_0x2b6c('0x1d')](_0x21c7ef)[_0x2b6c('0x25')](_0x52f0bf);}}});};exports[_0x2b6c('0x119')]=function(_0x3b2e57,_0x22ec7b){var _0x52f108={};var _0x1888e8={};var _0x20d148;var _0x5a7fc5;return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x3b2e57[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x22ec7b,null))[_0x2b6c('0x13')](function(_0x1b8507){if(_0x1b8507){_0x20d148=_0x1b8507;_0x1888e8[_0x2b6c('0x2e')]=_['keys'](db[_0x2b6c('0x91')][_0x2b6c('0x60')]);_0x1888e8[_0x2b6c('0x30')]=_['keys'](_0x3b2e57[_0x2b6c('0x30')]);_0x1888e8[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x1888e8[_0x2b6c('0x2e')],_0x1888e8[_0x2b6c('0x30')]);_0x52f108[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x1888e8[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x3b2e57['query'][_0x2b6c('0x35')]));_0x52f108[_0x2b6c('0x34')]=_0x52f108[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x52f108[_0x2b6c('0x34')]:_0x1888e8[_0x2b6c('0x2e')];_0x52f108[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x3b2e57['query'][_0x2b6c('0x39')]);_0x52f108['where']=qs[_0x2b6c('0x32')](_['pick'](_0x3b2e57[_0x2b6c('0x30')],_0x1888e8[_0x2b6c('0x32')]));if(_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x52f108[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x52f108['where'],{'$or':_[_0x2b6c('0x2f')](_0x52f108[_0x2b6c('0x34')],function(_0x54a8df){var _0x11e100={};_0x11e100[_0x54a8df]={'$like':'%'+_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x11e100;})});}_0x52f108=_[_0x2b6c('0x3d')]({},_0x52f108,_0x3b2e57[_0x2b6c('0x40')]);return _0x20d148[_0x2b6c('0x119')](_0x52f108);}})[_0x2b6c('0x13')](function(_0x55184d){if(_0x55184d){_0x5a7fc5=_0x55184d['length'];if(!_0x3b2e57[_0x2b6c('0x30')]['hasOwnProperty'](_0x2b6c('0x37'))){_0x52f108['limit']=qs[_0x2b6c('0x21')](_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x52f108[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x3b2e57[_0x2b6c('0x30')]['offset']);}return _0x20d148[_0x2b6c('0x119')](_0x52f108);}})['then'](function(_0xb9bb18){if(_0xb9bb18){return _0xb9bb18?{'count':_0x5a7fc5,'rows':_0xb9bb18}:null;}})[_0x2b6c('0x13')](respondWithResult(_0x22ec7b,null))[_0x2b6c('0x46')](handleError(_0x22ec7b,null));};exports[_0x2b6c('0x11a')]=function(_0x230ade,_0x1b1121){return db[_0x2b6c('0x11b')][_0x2b6c('0x56')]({'where':{'id':_0x230ade[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b1121,null))[_0x2b6c('0x13')](function(_0x1b307a){if(_0x1b307a){return _0x1b307a['addProactiveActions'](_0x230ade[_0x2b6c('0x4c')][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x230ade['body'],[_0x2b6c('0x5c'),'id'])||{});}})[_0x2b6c('0x13')](respondWithResult(_0x1b1121,null))['catch'](handleError(_0x1b1121,null));};exports['getProactiveActions']=function(_0x3283c8,_0x5f1159){var _0x14d3ca={};var _0x44f96e={};var _0x497c74;var _0x563443;return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x3283c8[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x5f1159,null))[_0x2b6c('0x13')](function(_0x4b9d75){if(_0x4b9d75){_0x497c74=_0x4b9d75;_0x44f96e[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0x11c')]['rawAttributes']);_0x44f96e[_0x2b6c('0x30')]=_['keys'](_0x3283c8[_0x2b6c('0x30')]);_0x44f96e[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x44f96e['model'],_0x44f96e['query']);_0x14d3ca[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x44f96e[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x3283c8['query'][_0x2b6c('0x35')]));_0x14d3ca['attributes']=_0x14d3ca[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x14d3ca['attributes']:_0x44f96e['model'];_0x14d3ca[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x3283c8[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x14d3ca[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x3283c8[_0x2b6c('0x30')],_0x44f96e[_0x2b6c('0x32')]));if(_0x3283c8['query'][_0x2b6c('0x3c')]){_0x14d3ca['where']=_['merge'](_0x14d3ca['where'],{'$or':_[_0x2b6c('0x2f')](_0x14d3ca[_0x2b6c('0x34')],function(_0x3c520e){var _0x12fa50={};_0x12fa50[_0x3c520e]={'$like':'%'+_0x3283c8['query']['filter']+'%'};return _0x12fa50;})});}_0x14d3ca=_[_0x2b6c('0x3d')]({},_0x14d3ca,_0x3283c8['options']);return _0x497c74[_0x2b6c('0xfc')](_0x14d3ca);}})['then'](function(_0xdf2863){if(_0xdf2863){_0x563443=_0xdf2863['length'];if(!_0x3283c8['query']['hasOwnProperty']('nolimit')){_0x14d3ca[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x3283c8[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x14d3ca[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x3283c8['query'][_0x2b6c('0x1f')]);}return _0x497c74[_0x2b6c('0xfc')](_0x14d3ca);}})[_0x2b6c('0x13')](function(_0x5464d2){if(_0x5464d2){return _0x5464d2?{'count':_0x563443,'rows':_0x5464d2}:null;}})[_0x2b6c('0x13')](respondWithResult(_0x5f1159,null))['catch'](handleError(_0x5f1159,null));};exports['getFields']=function(_0x5f31c4,_0x115a54){var _0x2a3a9a=_0x5f31c4[_0x2b6c('0x30')][_0x2b6c('0x11d')]==='false'?_0x2b6c('0x11e'):_0x2b6c('0x11f');return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'attributes':['id',_0x2a3a9a],'where':{'id':_0x5f31c4[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x115a54,null))['then'](function(_0x738986){if(_0x738986){var _0x578ed2=_0x738986[_0x2a3a9a];var _0x17d9cd=_0x578ed2&&_0x578ed2['items']?_0x578ed2['items']:[];_0x115a54['send']({'fromKey':_[_0x2b6c('0x71')](_0x578ed2['fromKey'])?undefined:_0x578ed2[_0x2b6c('0x120')],'count':_0x17d9cd[_0x2b6c('0x4a')],'rows':_0x17d9cd});}})[_0x2b6c('0x46')](handleError(_0x115a54,null));};exports[_0x2b6c('0x121')]=function(_0x4045be,_0x9306c5){var _0x8f32e9={'raw':![],'where':{}};var _0x473dff={};var _0x1b1951={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x4045be['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x9306c5,null))[_0x2b6c('0x13')](function(_0x28b585){if(_0x28b585){_0x473dff[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db['ChatOfflineMessage'][_0x2b6c('0x60')]);_0x473dff[_0x2b6c('0x30')]=_['keys'](_0x4045be['query']);_0x473dff[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x473dff[_0x2b6c('0x2e')],_0x473dff[_0x2b6c('0x30')]);_0x8f32e9[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x473dff['model'],qs[_0x2b6c('0x35')](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x8f32e9[_0x2b6c('0x34')]=_0x8f32e9[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x8f32e9[_0x2b6c('0x34')]:_0x473dff[_0x2b6c('0x2e')];if(!_0x4045be[_0x2b6c('0x30')]['hasOwnProperty'](_0x2b6c('0x37'))){_0x8f32e9['limit']=qs['limit'](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x8f32e9[_0x2b6c('0x1f')]=qs['offset'](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x8f32e9[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x8f32e9[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x4045be[_0x2b6c('0x30')],_0x473dff[_0x2b6c('0x32')]));_0x8f32e9[_0x2b6c('0x3a')][_0x2b6c('0x57')]=_0x28b585['id'];if(_0x4045be[_0x2b6c('0x30')]['filter']){_0x8f32e9[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x8f32e9[_0x2b6c('0x3a')],{'$or':_['map'](_0x8f32e9[_0x2b6c('0x34')],function(_0x114083){var _0x100d7d={};_0x100d7d[_0x114083]={'$like':'%'+_0x4045be[_0x2b6c('0x30')]['filter']+'%'};return _0x100d7d;})});}_0x8f32e9=_[_0x2b6c('0x3d')]({},_0x8f32e9,_0x4045be[_0x2b6c('0x40')]);return db['ChatOfflineMessage'][_0x2b6c('0x22')]({'where':_0x8f32e9[_0x2b6c('0x3a')]})[_0x2b6c('0x13')](function(_0x119724){_0x1b1951[_0x2b6c('0x22')]=_0x119724;if(_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x8f32e9['include']=[{'all':!![]}];}else{_0x8f32e9[_0x2b6c('0x43')]=[{'model':db[_0x2b6c('0x8f')],'as':_0x2b6c('0xe9'),'required':![]},{'model':db[_0x2b6c('0xd2')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x2b6c('0x44')](_0x8f32e9);})[_0x2b6c('0x13')](function(_0x2dc3fe){_0x1b1951[_0x2b6c('0x45')]=_0x2dc3fe;return _0x1b1951;});}})['then'](respondWithFilteredResult(_0x9306c5,_0x8f32e9))[_0x2b6c('0x46')](handleError(_0x9306c5,null));};exports[_0x2b6c('0x122')]=function(_0x222071,_0x2957e1){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0x222071[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2957e1,null))['then'](function(_0xc7de3c){if(_0xc7de3c){return _0xc7de3c[_0x2b6c('0x122')](_0x222071['body'][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x222071[_0x2b6c('0x4c')],['ids','id'])||{})[_0x2b6c('0xb0')](function(_0x217908){for(var _0x3a7e37=0x0;_0x3a7e37<_0x222071[_0x2b6c('0x4c')][_0x2b6c('0x5c')][_0x2b6c('0x4a')];_0x3a7e37+=0x1){socket['emit'](_0x2b6c('0x123'),{'UserId':Number(_0x222071[_0x2b6c('0x4c')][_0x2b6c('0x5c')][_0x3a7e37]),'ChatWebsiteId':Number(_0x222071[_0x2b6c('0x48')]['id'])});}return _0x217908;});}})[_0x2b6c('0x13')](respondWithResult(_0x2957e1,null))[_0x2b6c('0x46')](handleError(_0x2957e1,null));};exports[_0x2b6c('0x124')]=function(_0x54f785,_0x2a6e46){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x54f785['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x2a6e46,null))[_0x2b6c('0x13')](function(_0xef1e0f){if(_0xef1e0f){return _0xef1e0f[_0x2b6c('0x124')](_0x54f785[_0x2b6c('0x30')]['ids'])[_0x2b6c('0x13')](function(){if(_['isArray'](_0x54f785['query']['ids'])){for(var _0x30cae6=0x0;_0x30cae6<_0x54f785['query'][_0x2b6c('0x5c')][_0x2b6c('0x4a')];_0x30cae6+=0x1){socket[_0x2b6c('0x125')](_0x2b6c('0x126'),{'UserId':Number(_0x54f785[_0x2b6c('0x30')][_0x2b6c('0x5c')][_0x30cae6]),'ChatWebsiteId':Number(_0x54f785['params']['id'])});}}else{socket['emit'](_0x2b6c('0x126'),{'UserId':Number(_0x54f785[_0x2b6c('0x30')]['ids']),'ChatWebsiteId':Number(_0x54f785[_0x2b6c('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a6e46,null))[_0x2b6c('0x46')](handleError(_0x2a6e46,null));};exports['getAgents']=function(_0x2e65ce,_0x19aff4){var _0x34aa12={};var _0x1f27f3={};var _0x1a8a0e;var _0x1a976c;return db[_0x2b6c('0x41')]['findOne']({'where':{'id':_0x2e65ce[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x19aff4,null))[_0x2b6c('0x13')](function(_0x32f5e8){if(_0x32f5e8){_0x1a8a0e=_0x32f5e8;_0x1f27f3[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0xea')]['rawAttributes']);_0x1f27f3[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x2e65ce['query']);_0x1f27f3[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x1f27f3[_0x2b6c('0x2e')],_0x1f27f3[_0x2b6c('0x30')]);_0x34aa12['attributes']=_[_0x2b6c('0x33')](_0x1f27f3[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x34aa12[_0x2b6c('0x34')]=_0x34aa12[_0x2b6c('0x34')]['length']?_0x34aa12[_0x2b6c('0x34')]:_0x1f27f3[_0x2b6c('0x2e')];_0x34aa12[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x2e65ce[_0x2b6c('0x30')]['sort']);_0x34aa12[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x2e65ce[_0x2b6c('0x30')],_0x1f27f3[_0x2b6c('0x32')]));if(_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x34aa12['where']=_[_0x2b6c('0x3d')](_0x34aa12[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0x34aa12[_0x2b6c('0x34')],function(_0x7de937){var _0x2313be={};_0x2313be[_0x7de937]={'$like':'%'+_0x2e65ce['query'][_0x2b6c('0x3c')]+'%'};return _0x2313be;})});}_0x34aa12=_['merge']({},_0x34aa12,_0x2e65ce[_0x2b6c('0x40')]);return _0x1a8a0e[_0x2b6c('0x127')](_0x34aa12);}})[_0x2b6c('0x13')](function(_0xd50fc1){if(_0xd50fc1){_0x1a976c=_0xd50fc1['length'];if(!_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x36')]('nolimit')){_0x34aa12[_0x2b6c('0x21')]=qs['limit'](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x34aa12[_0x2b6c('0x1f')]=qs['offset'](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}return _0x1a8a0e[_0x2b6c('0x127')](_0x34aa12);}})[_0x2b6c('0x13')](function(_0x451ecc){if(_0x451ecc){return _0x451ecc?{'count':_0x1a976c,'rows':_0x451ecc}:null;}})['then'](respondWithResult(_0x19aff4,null))[_0x2b6c('0x46')](handleError(_0x19aff4,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 91e45e8..b94e5d6 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 _0x5a93=['exports','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x4399a6,_0x4f3ef7){var _0x20ba25=function(_0x5c9e3c){while(--_0x5c9e3c){_0x4399a6['push'](_0x4399a6['shift']());}};_0x20ba25(++_0x4f3ef7);}(_0x5a93,0xf6));var _0x35a9=function(_0x1e1017,_0x55783a){_0x1e1017=_0x1e1017-0x0;var _0x362a58=_0x5a93[_0x1e1017];return _0x362a58;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x35a9('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x35a9('0x1')](0x0);var events={'afterCreate':_0x35a9('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7dc79f){return function(_0xf10dcf,_0x3a23d6,_0x4f45aa){ChatWebsiteEvents[_0x35a9('0x3')](_0x7dc79f+':'+_0xf10dcf['id'],_0xf10dcf);ChatWebsiteEvents[_0x35a9('0x3')](_0x7dc79f,_0xf10dcf);_0x4f45aa(null);};}for(var e in events){if(events[_0x35a9('0x4')](e)){var event=events[e];ChatWebsite[_0x35a9('0x5')](e,emitEvent(event));}}module[_0x35a9('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x1ef3=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x166435,_0x16391f){var _0xe4713a=function(_0xea464f){while(--_0xea464f){_0x166435['push'](_0x166435['shift']());}};_0xe4713a(++_0x16391f);}(_0x1ef3,0x69));var _0x31ef=function(_0x189516,_0x14a8f6){_0x189516=_0x189516-0x0;var _0x1cdd69=_0x1ef3[_0x189516];return _0x1cdd69;};'use strict';var EventEmitter=require(_0x31ef('0x0'));var ChatWebsite=require(_0x31ef('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x31ef('0x2')](0x0);var events={'afterCreate':_0x31ef('0x3'),'afterUpdate':_0x31ef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x311a32){return function(_0x58388a,_0x49ce87,_0x1a8d7f){ChatWebsiteEvents[_0x31ef('0x5')](_0x311a32+':'+_0x58388a['id'],_0x58388a);ChatWebsiteEvents[_0x31ef('0x5')](_0x311a32,_0x58388a);_0x1a8d7f(null);};}for(var e in events){if(events[_0x31ef('0x6')](e)){var event=events[e];ChatWebsite[_0x31ef('0x7')](e,emitEvent(event));}}module[_0x31ef('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 642a559..39dbece 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 _0xe9b1=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x27b2fd,_0x8c95b8){var _0x135f31=function(_0x13494d){while(--_0x13494d){_0x27b2fd['push'](_0x27b2fd['shift']());}};_0x135f31(++_0x8c95b8);}(_0xe9b1,0xaf));var _0x1e9b=function(_0x5bdb83,_0x3605de){_0x5bdb83=_0x5bdb83-0x0;var _0x1986bb=_0xe9b1[_0x5bdb83];return _0x1986bb;};'use strict';var _=require(_0x1e9b('0x0'));var util=require(_0x1e9b('0x1'));var logger=require(_0x1e9b('0x2'))(_0x1e9b('0x3'));var moment=require(_0x1e9b('0x4'));var BPromise=require(_0x1e9b('0x5'));var rp=require(_0x1e9b('0x6'));var fs=require('fs');var path=require(_0x1e9b('0x7'));var rimraf=require(_0x1e9b('0x8'));var config=require(_0x1e9b('0x9'));var attributes=require(_0x1e9b('0xa'));module[_0x1e9b('0xb')]=function(_0x41c896,_0x7de997){return _0x41c896['define'](_0x1e9b('0xc'),attributes,{'tableName':_0x1e9b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0137=['rimraf','exports','define','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x183f7e,_0xa61ba7){var _0x590260=function(_0x109b31){while(--_0x109b31){_0x183f7e['push'](_0x183f7e['shift']());}};_0x590260(++_0xa61ba7);}(_0x0137,0x1a8));var _0x7013=function(_0x173ec0,_0x4374db){_0x173ec0=_0x173ec0-0x0;var _0xcbf53d=_0x0137[_0x173ec0];return _0xcbf53d;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require(_0x7013('0x5'));var rp=require(_0x7013('0x6'));var fs=require('fs');var path=require(_0x7013('0x7'));var rimraf=require(_0x7013('0x8'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x7013('0x9')]=function(_0x2d7771,_0x38a446){return _0x2d7771[_0x7013('0xa')]('ChatWebsite',attributes,{'tableName':_0x7013('0xb'),'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 c01ec17..6f1dd87 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 _0xad67=['redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ca7f2,_0x565a83){var _0x51ca1b=function(_0xde6828){while(--_0xde6828){_0x5ca7f2['push'](_0x5ca7f2['shift']());}};_0x51ca1b(++_0x565a83);}(_0xad67,0x81));var _0x7ad6=function(_0x2f1753,_0x458f6d){_0x2f1753=_0x2f1753-0x0;var _0x56a164=_0xad67[_0x2f1753];return _0x56a164;};'use strict';var _=require(_0x7ad6('0x0'));var util=require(_0x7ad6('0x1'));var moment=require(_0x7ad6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ad6('0x3'))['db'];var utils=require(_0x7ad6('0x4'));var logger=require(_0x7ad6('0x5'))(_0x7ad6('0x6'));var config=require(_0x7ad6('0x7'));var jayson=require(_0x7ad6('0x8'));var client=jayson[_0x7ad6('0x9')][_0x7ad6('0xa')]({'port':0x232a});config[_0x7ad6('0xb')]=_[_0x7ad6('0xc')](config[_0x7ad6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ad6('0xd'))(new Redis(config[_0x7ad6('0xb')]));require(_0x7ad6('0xe'))[_0x7ad6('0xf')](socket);function respondWithRpcPromise(_0x4b6b51,_0x1544e0,_0x5d0b23){return new BPromise(function(_0x4fe155,_0x39cf35){return client[_0x7ad6('0x10')](_0x4b6b51,_0x5d0b23)[_0x7ad6('0x11')](function(_0x3bf1e7){logger[_0x7ad6('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1544e0,_0x7ad6('0x13'));logger['debug'](_0x7ad6('0x14'),_0x1544e0,'request\x20sent',JSON[_0x7ad6('0x15')](_0x3bf1e7));if(_0x3bf1e7['error']){if(_0x3bf1e7[_0x7ad6('0x16')][_0x7ad6('0x17')]===0x1f4){logger['error'](_0x7ad6('0x18'),_0x1544e0,_0x3bf1e7[_0x7ad6('0x16')]['message']);return _0x39cf35(_0x3bf1e7[_0x7ad6('0x16')][_0x7ad6('0x19')]);}logger['error'](_0x7ad6('0x18'),_0x1544e0,_0x3bf1e7[_0x7ad6('0x16')]['message']);return _0x4fe155(_0x3bf1e7[_0x7ad6('0x16')]['message']);}else{logger[_0x7ad6('0x12')](_0x7ad6('0x18'),_0x1544e0,_0x7ad6('0x13'));_0x4fe155(_0x3bf1e7[_0x7ad6('0x1a')][_0x7ad6('0x19')]);}})[_0x7ad6('0x1b')](function(_0x165160){logger[_0x7ad6('0x16')](_0x7ad6('0x18'),_0x1544e0,_0x165160);_0x39cf35(_0x165160);});});}
\ No newline at end of file
+var _0xe803=['register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0xe803,0x90));var _0x3e80=function(_0x472a2d,_0x7b6a64){_0x472a2d=_0x472a2d-0x0;var _0x58c1eb=_0xe803[_0x472a2d];return _0x58c1eb;};'use strict';var _=require('lodash');var util=require(_0x3e80('0x0'));var moment=require(_0x3e80('0x1'));var BPromise=require('bluebird');var rs=require(_0x3e80('0x2'));var fs=require('fs');var Redis=require(_0x3e80('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e80('0x4'));var logger=require(_0x3e80('0x5'))(_0x3e80('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3e80('0x7')][_0x3e80('0x8')]({'port':0x232a});config[_0x3e80('0x9')]=_[_0x3e80('0xa')](config[_0x3e80('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e80('0xb'))(new Redis(config[_0x3e80('0x9')]));require('./chatWebsite.socket')[_0x3e80('0xc')](socket);function respondWithRpcPromise(_0x1712b9,_0x417fc4,_0x3fbc8d){return new BPromise(function(_0x2d31db,_0x1230de){return client[_0x3e80('0xd')](_0x1712b9,_0x3fbc8d)[_0x3e80('0xe')](function(_0x4520ce){logger[_0x3e80('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x417fc4,_0x3e80('0x10'));logger[_0x3e80('0x11')](_0x3e80('0x12'),_0x417fc4,_0x3e80('0x10'),JSON[_0x3e80('0x13')](_0x4520ce));if(_0x4520ce[_0x3e80('0x14')]){if(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x15')]===0x1f4){logger[_0x3e80('0x14')](_0x3e80('0x16'),_0x417fc4,_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);return _0x1230de(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);}logger[_0x3e80('0x14')](_0x3e80('0x16'),_0x417fc4,_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);return _0x2d31db(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);}else{logger['info'](_0x3e80('0x16'),_0x417fc4,_0x3e80('0x10'));_0x2d31db(_0x4520ce[_0x3e80('0x18')][_0x3e80('0x17')]);}})[_0x3e80('0x19')](function(_0x52d6f){logger['error'](_0x3e80('0x16'),_0x417fc4,_0x52d6f);_0x1230de(_0x52d6f);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 643f52b..0c58fa3 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 _0x44e8=['register','length','chatWebsite:','save','removeListener'];(function(_0x457b18,_0x1c99ab){var _0x38ffac=function(_0x19172a){while(--_0x19172a){_0x457b18['push'](_0x457b18['shift']());}};_0x38ffac(++_0x1c99ab);}(_0x44e8,0x107));var _0x844e=function(_0x16ed97,_0x363ac8){_0x16ed97=_0x16ed97-0x0;var _0x215fad=_0x44e8[_0x16ed97];return _0x215fad;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x844e('0x0'),'remove','update'];function createListener(_0x24c1af,_0x154d28){return function(_0x5d046b){_0x154d28['emit'](_0x24c1af,_0x5d046b);};}function removeListener(_0x1674d0,_0x891a47){return function(){ChatWebsiteEvents[_0x844e('0x1')](_0x1674d0,_0x891a47);};}exports[_0x844e('0x2')]=function(_0x433218){for(var _0x4a2dab=0x0,_0x5ab3b1=events[_0x844e('0x3')];_0x4a2dab<_0x5ab3b1;_0x4a2dab++){var _0x20ee2c=events[_0x4a2dab];var _0x396608=createListener(_0x844e('0x4')+_0x20ee2c,_0x433218);ChatWebsiteEvents['on'](_0x20ee2c,_0x396608);}};
\ No newline at end of file
+var _0x602f=['emit','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x265596,_0x23947a){var _0x3f8d6b=function(_0x46349d){while(--_0x46349d){_0x265596['push'](_0x265596['shift']());}};_0x3f8d6b(++_0x23947a);}(_0x602f,0x1f4));var _0xf602=function(_0x429b19,_0x23615c){_0x429b19=_0x429b19-0x0;var _0x5849fa=_0x602f[_0x429b19];return _0x5849fa;};'use strict';var ChatWebsiteEvents=require(_0xf602('0x0'));var events=[_0xf602('0x1'),_0xf602('0x2'),_0xf602('0x3')];function createListener(_0x48a35d,_0x581259){return function(_0x366680){_0x581259[_0xf602('0x4')](_0x48a35d,_0x366680);};}function removeListener(_0x30f82f,_0x4a51d9){return function(){ChatWebsiteEvents['removeListener'](_0x30f82f,_0x4a51d9);};}exports['register']=function(_0x5552cc){for(var _0x52691d=0x0,_0x19f993=events[_0xf602('0x5')];_0x52691d<_0x19f993;_0x52691d++){var _0x466324=events[_0x52691d];var _0x420e8c=createListener(_0xf602('0x6')+_0x466324,_0x5552cc);ChatWebsiteEvents['on'](_0x466324,_0x420e8c);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 1c36c0f..b3f4a40 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 _0x5e89=['getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','create','/:id/dispositions','addDisposition','post','diskStorage','join','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','root','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications'];(function(_0x568c2a,_0x436eb8){var _0x373a36=function(_0x1d59e5){while(--_0x1d59e5){_0x568c2a['push'](_0x568c2a['shift']());}};_0x373a36(++_0x436eb8);}(_0x5e89,0x165));var _0x95e8=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5e89[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0x95e8('0x0'));var util=require(_0x95e8('0x1'));var path=require(_0x95e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x95e8('0x3'));var router=express['Router']();var fs_extra=require(_0x95e8('0x4'));var auth=require(_0x95e8('0x5'));var interaction=require(_0x95e8('0x6'));var config=require(_0x95e8('0x7'));var controller=require(_0x95e8('0x8'));router[_0x95e8('0x9')]('/',auth[_0x95e8('0xa')](),controller[_0x95e8('0xb')]);router[_0x95e8('0x9')](_0x95e8('0xc'),auth[_0x95e8('0xa')](),controller[_0x95e8('0xd')]);router[_0x95e8('0x9')]('/:id',auth[_0x95e8('0xa')](),controller[_0x95e8('0xe')]);router[_0x95e8('0x9')]('/:id/dispositions',auth[_0x95e8('0xa')](),controller[_0x95e8('0xf')]);router[_0x95e8('0x9')](_0x95e8('0x10'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x11')]);router['get'](_0x95e8('0x12'),controller[_0x95e8('0x13')]);router[_0x95e8('0x9')](_0x95e8('0x14'),controller[_0x95e8('0x15')]);router[_0x95e8('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router[_0x95e8('0x9')](_0x95e8('0x16'),auth['isAuthenticated'](),controller[_0x95e8('0x17')]);router[_0x95e8('0x9')](_0x95e8('0x18'),controller[_0x95e8('0x19')]);router[_0x95e8('0x9')](_0x95e8('0x1a'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x1b')]);router[_0x95e8('0x9')]('/:id/proactive_actions',auth[_0x95e8('0xa')](),controller[_0x95e8('0x1c')]);router[_0x95e8('0x9')]('/:id/fields',controller[_0x95e8('0x1d')]);router[_0x95e8('0x9')]('/:id/offline_messages',auth[_0x95e8('0xa')](),controller[_0x95e8('0x1e')]);router[_0x95e8('0x9')](_0x95e8('0x1f'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x20')]);router['post']('/',auth['isAuthenticated'](),controller[_0x95e8('0x21')]);router['post'](_0x95e8('0x22'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x23')]);router[_0x95e8('0x24')](_0x95e8('0x10'),auth[_0x95e8('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x95e8('0x25')]({'destination':function(_0x1d0ef8,_0x548e62,_0x551dad){_0x551dad(null,path[_0x95e8('0x26')](config['root'],_0x95e8('0x27')));},'filename':function(_0x502a10,_0x5cc0d1,_0x2b2bac){_0x2b2bac(null,util['format'](_0x95e8('0x28'),Date[_0x95e8('0x29')](),_0x5cc0d1[_0x95e8('0x2a')]));}})});router['post']('/:id/logo',upload[_0x95e8('0x2b')](_0x95e8('0x2c')),controller[_0x95e8('0x2d')]);var upload=multer({'storage':multer[_0x95e8('0x25')]({'destination':function(_0x32ea34,_0x5d37ec,_0x46ee93){_0x46ee93(null,path['join'](config[_0x95e8('0x2e')],_0x95e8('0x2f')));},'filename':function(_0x2b0b33,_0x346631,_0x143a2a){_0x143a2a(null,util[_0x95e8('0x30')]('%s-%s',Date[_0x95e8('0x29')](),_0x346631[_0x95e8('0x2a')]));}})});router[_0x95e8('0x24')](_0x95e8('0x14'),upload[_0x95e8('0x2b')](_0x95e8('0x2c')),controller[_0x95e8('0x31')]);var upload=multer({'storage':multer[_0x95e8('0x25')]({'destination':function(_0x5a6020,_0x2ed3b3,_0x28e19e){_0x28e19e(null,path['join'](config[_0x95e8('0x2e')],_0x95e8('0x2f')));},'filename':function(_0x2c7b13,_0x27fe33,_0x2657ff){_0x2657ff(null,util[_0x95e8('0x30')](_0x95e8('0x28'),Date[_0x95e8('0x29')](),_0x27fe33[_0x95e8('0x2a')]));}})});router[_0x95e8('0x24')](_0x95e8('0x32'),upload[_0x95e8('0x2b')](_0x95e8('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52797f,_0x42f59e,_0x56fd84){_0x56fd84(null,path['join'](config[_0x95e8('0x2e')],_0x95e8('0x2f')));},'filename':function(_0x3966b9,_0x283dc6,_0x28a234){_0x28a234(null,util[_0x95e8('0x30')](_0x95e8('0x28'),Date[_0x95e8('0x29')](),_0x283dc6[_0x95e8('0x2a')]));}})});router[_0x95e8('0x24')](_0x95e8('0x33'),upload[_0x95e8('0x2b')](_0x95e8('0x2c')),controller[_0x95e8('0x34')]);router[_0x95e8('0x24')](_0x95e8('0x35'),controller[_0x95e8('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x95e8('0x25')]({'destination':function(_0x382ebb,_0x3d8da4,_0x47f36f){const _0x531946=path[_0x95e8('0x26')](config[_0x95e8('0x2e')],_0x95e8('0x37'),_0x95e8('0x38'),_0x95e8('0x39'));fs_extra[_0x95e8('0x3a')](_0x531946,function(){_0x47f36f(null,_0x531946);});},'filename':function(_0x1d147e,_0x574fb8,_0x49c6cc){const _0x23ec39=_0x574fb8[_0x95e8('0x2a')][_0x95e8('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x597bd2=path[_0x95e8('0x3c')](_0x23ec39);const _0x520e03=Date[_0x95e8('0x29')]()+'-'+_0x23ec39[_0x95e8('0x3b')](_0x597bd2,'')+_0x597bd2;_0x49c6cc(null,_0x520e03);}})});router[_0x95e8('0x24')](_0x95e8('0x3d'),offlineUploadMulter[_0x95e8('0x3e')](),controller[_0x95e8('0x3f')]);router['post'](_0x95e8('0x16'),auth[_0x95e8('0xa')](),controller['addInteraction']);router['post'](_0x95e8('0x1a'),auth['isAuthenticated'](),controller[_0x95e8('0x40')]);router[_0x95e8('0x24')](_0x95e8('0x41'),auth['isAuthenticated'](),controller[_0x95e8('0x42')]);router[_0x95e8('0x24')](_0x95e8('0x1f'),auth['isAuthenticated'](),controller[_0x95e8('0x43')]);router[_0x95e8('0x44')](_0x95e8('0x45'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x46')]);router[_0x95e8('0x47')](_0x95e8('0x45'),auth[_0x95e8('0xa')](),controller[_0x95e8('0x48')]);router['delete'](_0x95e8('0x22'),auth['isAuthenticated'](),controller[_0x95e8('0x49')]);router[_0x95e8('0x47')](_0x95e8('0x10'),auth['isAuthenticated'](),controller[_0x95e8('0x4a')]);router[_0x95e8('0x47')]('/:id/users',auth[_0x95e8('0xa')](),controller[_0x95e8('0x4b')]);module[_0x95e8('0x4c')]=router;
\ No newline at end of file
+var _0xed77=['/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','now','/:id/avatar','addAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','delete','removeAnswers','removeAgents','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet'];(function(_0x4d4ea2,_0x4858f4){var _0x1ba039=function(_0x14c589){while(--_0x14c589){_0x4d4ea2['push'](_0x4d4ea2['shift']());}};_0x1ba039(++_0x4858f4);}(_0xed77,0x147));var _0x7ed7=function(_0x241b38,_0x59a7b1){_0x241b38=_0x241b38-0x0;var _0x9619ea=_0xed77[_0x241b38];return _0x9619ea;};'use strict';var multer=require(_0x7ed7('0x0'));var util=require('util');var path=require(_0x7ed7('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ed7('0x2'));var router=express[_0x7ed7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7ed7('0x4'));var config=require(_0x7ed7('0x5'));var controller=require(_0x7ed7('0x6'));router['get']('/',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x8')]);router[_0x7ed7('0x9')](_0x7ed7('0xa'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0xb')]);router[_0x7ed7('0x9')](_0x7ed7('0xc'),auth['isAuthenticated'](),controller[_0x7ed7('0xd')]);router[_0x7ed7('0x9')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0xf')]);router['get'](_0x7ed7('0x10'),auth[_0x7ed7('0x7')](),controller['getAnswers']);router[_0x7ed7('0x9')]('/:id/logo',controller['getLogo']);router[_0x7ed7('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0x7ed7('0x11'),controller['getCustomerAvatar']);router['get'](_0x7ed7('0x12'),controller[_0x7ed7('0x13')]);router[_0x7ed7('0x9')]('/:id/interactions',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x14')]);router['get'](_0x7ed7('0x15'),controller[_0x7ed7('0x16')]);router[_0x7ed7('0x9')](_0x7ed7('0x17'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x18')]);router[_0x7ed7('0x9')](_0x7ed7('0x19'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x1a')]);router[_0x7ed7('0x9')](_0x7ed7('0x1b'),controller[_0x7ed7('0x1c')]);router[_0x7ed7('0x9')](_0x7ed7('0x1d'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x1e')]);router[_0x7ed7('0x9')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x20')]);router[_0x7ed7('0x21')]('/',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x22')]);router[_0x7ed7('0x21')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x23')]);router[_0x7ed7('0x21')](_0x7ed7('0x10'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x7ed7('0x24')]({'destination':function(_0xfc0d36,_0x1ef40e,_0xc94603){_0xc94603(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x27')));},'filename':function(_0x3d4e38,_0x189696,_0x304f62){_0x304f62(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date['now'](),_0x189696[_0x7ed7('0x2a')]));}})});router['post'](_0x7ed7('0x2b'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller[_0x7ed7('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ebc83,_0x374476,_0x5e4922){_0x5e4922(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x44276e,_0x25bdf0,_0x56e670){_0x56e670(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0x25bdf0[_0x7ed7('0x2a')]));}})});router[_0x7ed7('0x21')](_0x7ed7('0x31'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller[_0x7ed7('0x32')]);var upload=multer({'storage':multer[_0x7ed7('0x24')]({'destination':function(_0x42edb0,_0x26d0a4,_0x2a8cf2){_0x2a8cf2(null,path['join'](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x1a2dde,_0x13d762,_0x4ea07d){_0x4ea07d(null,util['format'](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0x13d762[_0x7ed7('0x2a')]));}})});router['post'](_0x7ed7('0x11'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x10c7ac,_0x2d4e3b,_0x1b79a5){_0x1b79a5(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x4210cc,_0xed6371,_0x1da905){_0x1da905(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0xed6371[_0x7ed7('0x2a')]));}})});router[_0x7ed7('0x21')]('/:id/system_avatar',upload[_0x7ed7('0x2c')]('file'),controller[_0x7ed7('0x33')]);router[_0x7ed7('0x21')]('/:id/notify',controller[_0x7ed7('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x11b7ac,_0x3cc977,_0x18840f){const _0x52a76f=path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x35'),_0x7ed7('0x36'),_0x7ed7('0x37'));fs_extra[_0x7ed7('0x38')](_0x52a76f,function(){_0x18840f(null,_0x52a76f);});},'filename':function(_0x181ec7,_0x5dd77b,_0x33f3ad){const _0x4e9726=_0x5dd77b[_0x7ed7('0x2a')][_0x7ed7('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x44a31d=path[_0x7ed7('0x3a')](_0x4e9726);const _0xf7d880=Date[_0x7ed7('0x30')]()+'-'+_0x4e9726[_0x7ed7('0x39')](_0x44a31d,'')+_0x44a31d;_0x33f3ad(null,_0xf7d880);}})});router[_0x7ed7('0x21')](_0x7ed7('0x3b'),offlineUploadMulter[_0x7ed7('0x3c')](),controller[_0x7ed7('0x3d')]);router[_0x7ed7('0x21')](_0x7ed7('0x3e'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x3f')]);router[_0x7ed7('0x21')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x7ed7('0x21')](_0x7ed7('0x19'),auth['isAuthenticated'](),controller[_0x7ed7('0x40')]);router[_0x7ed7('0x21')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x41')]);router['put'](_0x7ed7('0xc'),auth[_0x7ed7('0x7')](),controller['update']);router['delete'](_0x7ed7('0xc'),auth[_0x7ed7('0x7')](),controller['destroy']);router[_0x7ed7('0x42')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller['removeDispositions']);router[_0x7ed7('0x42')](_0x7ed7('0x10'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x43')]);router[_0x7ed7('0x42')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x44')]);module[_0x7ed7('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 749c365..d4d14ca 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x62ed=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x5a633a,_0x4e8830){var _0x4a9df=function(_0x1a6732){while(--_0x1a6732){_0x5a633a['push'](_0x5a633a['shift']());}};_0x4a9df(++_0x4e8830);}(_0x62ed,0x115));var _0xd62e=function(_0x40258b,_0x1db52e){_0x40258b=_0x40258b-0x0;var _0x498cf2=_0x62ed[_0x40258b];return _0x498cf2;};var beaverLogger=require(_0xd62e('0x0'));var express=require(_0xd62e('0x1'));var auth=require(_0xd62e('0x2'));var config=require(_0xd62e('0x3'));var router=express[_0xd62e('0x4')]();var isProduction=config[_0xd62e('0x5')]==='production'||![];function clientSideLogs(_0x3db6d0,_0x3ac8ae,_0x5377a7){var _0x50ad49=_0x3db6d0[_0xd62e('0x6')][_0xd62e('0x7')]('client-side-logger');if(!_0x50ad49){throw new Error(_0xd62e('0x8'));}return beaverLogger[_0xd62e('0x9')]({'uri':_0xd62e('0xa'),'logger':_0x50ad49,'enableCors':!isProduction})(_0x3db6d0,_0x3ac8ae,_0x5377a7);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xd62e('0xb')]=router;
\ No newline at end of file
+var _0xe5ae=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production'];(function(_0x4d930e,_0x434ebe){var _0xbda995=function(_0x5b4b5e){while(--_0x5b4b5e){_0x4d930e['push'](_0x4d930e['shift']());}};_0xbda995(++_0x434ebe);}(_0xe5ae,0x186));var _0xee5a=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0xe5ae[_0x149083];return _0x4dc74e;};var beaverLogger=require(_0xee5a('0x0'));var express=require('express');var auth=require(_0xee5a('0x1'));var config=require(_0xee5a('0x2'));var router=express[_0xee5a('0x3')]();var isProduction=config[_0xee5a('0x4')]===_0xee5a('0x5')||![];function clientSideLogs(_0x4bb2b1,_0x234fbd,_0x35e8d7){var _0x532089=_0x4bb2b1['app']['get'](_0xee5a('0x6'));if(!_0x532089){throw new Error(_0xee5a('0x7'));}return beaverLogger[_0xee5a('0x8')]({'uri':_0xee5a('0x9'),'logger':_0x532089,'enableCors':!isProduction})(_0x4bb2b1,_0x234fbd,_0x35e8d7);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xee5a('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index ccd727c..4d45e5a 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x745d=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0x745d,0xe2));var _0xd745=function(_0x265c51,_0x199578){_0x265c51=_0x265c51-0x0;var _0x3faf9d=_0x745d[_0x265c51];return _0x3faf9d;};'use strict';var Sequelize=require(_0xd745('0x0'));module[_0xd745('0x1')]={'name':{'type':Sequelize[_0xd745('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd745('0x3')]('AmazonAWS',_0xd745('0x4'),_0xd745('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd745('0x3')]('Outlook365',_0xd745('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xd745('0x7')},'data2':{'type':Sequelize[_0xd745('0x2')],'comment':_0xd745('0x8')},'data3':{'type':Sequelize[_0xd745('0x2')],'comment':_0xd745('0x9')},'data4':{'type':Sequelize[_0xd745('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xd745('0xa')],'comment':_0xd745('0xb')},'data6':{'type':Sequelize[_0xd745('0xa')],'comment':_0xd745('0xc')},'data7':{'type':Sequelize[_0xd745('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x1152=['STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x382541,_0x40226e){var _0x3d0287=function(_0x41caf7){while(--_0x41caf7){_0x382541['push'](_0x382541['shift']());}};_0x3d0287(++_0x40226e);}(_0x1152,0x167));var _0x2115=function(_0x5608df,_0xff2326){_0x5608df=_0x5608df-0x0;var _0x4c2e63=_0x1152[_0x5608df];return _0x4c2e63;};'use strict';var Sequelize=require('sequelize');module[_0x2115('0x0')]={'name':{'type':Sequelize[_0x2115('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x2115('0x2'),_0x2115('0x3'),_0x2115('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2115('0x5')]('Outlook365',_0x2115('0x6'))},'data1':{'type':Sequelize[_0x2115('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x7')},'data3':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x8')},'data4':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x2115('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x2115('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 11e61a5..33f8792 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91bf=['VIRTUAL','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','./cloudProvider.oauth','defaults','redis','socket.io-emitter','sendStatus','limit','undefined','offset','count','status','set','Content-Range','then','error','name','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','pick','filters','filter','merge','where'];(function(_0xb0bfd6,_0x2ca684){var _0x2924fc=function(_0xf0e69a){while(--_0xf0e69a){_0xb0bfd6['push'](_0xb0bfd6['shift']());}};_0x2924fc(++_0x2ca684);}(_0x91bf,0x147));var _0xf91b=function(_0x522b58,_0x527a40){_0x522b58=_0x522b58-0x0;var _0x1ee0f0=_0x91bf[_0x522b58];return _0x1ee0f0;};'use strict';var _=require(_0xf91b('0x0'));var Redis=require(_0xf91b('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf91b('0x2'));var config=require(_0xf91b('0x3'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xf91b('0x4'));config['redis']=_[_0xf91b('0x5')](config[_0xf91b('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xf91b('0x7'))(new Redis(config['redis']));var redis=new Redis(config[_0xf91b('0x6')]);function respondWithStatusCode(_0x24115b,_0x4bf91f){_0x4bf91f=_0x4bf91f||0xcc;return function(_0x4e75a8){if(_0x4e75a8){return _0x24115b[_0xf91b('0x8')](_0x4bf91f);}return _0x24115b['status'](_0x4bf91f)['end']();};}function respondWithResult(_0x2859e3,_0x4aa71e){_0x4aa71e=_0x4aa71e||0xc8;return function(_0x2053b4){if(_0x2053b4){return _0x2859e3['status'](_0x4aa71e)['json'](_0x2053b4);}};}function respondWithFilteredResult(_0x2e66ba,_0x449a17){return function(_0x42dca2){if(_0x42dca2){var _0x55bee8=typeof _0x449a17['offset']==='undefined'&&typeof _0x449a17[_0xf91b('0x9')]===_0xf91b('0xa');var _0x191cd9=_0x42dca2['count'];var _0x59945b=_0x55bee8?0x0:_0x449a17[_0xf91b('0xb')];var _0x299b71=_0x55bee8?_0x42dca2[_0xf91b('0xc')]:_0x449a17['offset']+_0x449a17['limit'];var _0x3bb0a7;if(_0x299b71>=_0x191cd9){_0x299b71=_0x191cd9;_0x3bb0a7=0xc8;}else{_0x3bb0a7=0xce;}_0x2e66ba[_0xf91b('0xd')](_0x3bb0a7);return _0x2e66ba[_0xf91b('0xe')](_0xf91b('0xf'),_0x59945b+'-'+_0x299b71+'/'+_0x191cd9)['json'](_0x42dca2);}return null;};}function saveUpdates(_0x2f056d){return function(_0x3fd8ec){if(_0x3fd8ec){return _0x3fd8ec['update'](_0x2f056d)[_0xf91b('0x10')](function(_0x30d7e4){return _0x30d7e4;});}return null;};}function removeEntity(_0x3d8fe0){return function(_0xa0c494){if(_0xa0c494){return _0xa0c494['destroy']()[_0xf91b('0x10')](function(){_0x3d8fe0[_0xf91b('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x198380){return function(_0x57cf85){if(!_0x57cf85){_0x198380[_0xf91b('0x8')](0x194);}return _0x57cf85;};}function handleError(_0x181bb2,_0x4de572){_0x4de572=_0x4de572||0x1f4;return function(_0x8ee907){logger[_0xf91b('0x11')](_0x8ee907['stack']);if(_0x8ee907['name']){delete _0x8ee907[_0xf91b('0x12')];}_0x181bb2[_0xf91b('0xd')](_0x4de572)['send'](_0x8ee907);};}function maskClientSecret(_0x4c0c38){return _[_0xf91b('0x13')](_0x4c0c38['slice'](0x0,0x3),0x14,'*');}exports[_0xf91b('0x14')]=function(_0x50bc91,_0x4148eb){var _0x57f318={},_0x190a46={},_0x18b8f0={'count':0x0,'rows':[]};var _0x137c13=_[_0xf91b('0x15')](db[_0xf91b('0x16')][_0xf91b('0x17')],function(_0x2d48d3){return{'name':_0x2d48d3[_0xf91b('0x18')],'type':_0x2d48d3[_0xf91b('0x19')][_0xf91b('0x1a')]};});_0x190a46[_0xf91b('0x1b')]=_[_0xf91b('0x15')](_0x137c13,_0xf91b('0x12'));_0x190a46['query']=_[_0xf91b('0x1c')](_0x50bc91['query']);_0x190a46['filters']=_[_0xf91b('0x1d')](_0x190a46[_0xf91b('0x1b')],_0x190a46[_0xf91b('0x1e')]);_0x57f318['attributes']=_[_0xf91b('0x1d')](_0x190a46['model'],qs[_0xf91b('0x1f')](_0x50bc91[_0xf91b('0x1e')]['fields']));_0x57f318[_0xf91b('0x20')]=_0x57f318['attributes']['length']?_0x57f318[_0xf91b('0x20')]:_0x190a46[_0xf91b('0x1b')];if(!_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x21')](_0xf91b('0x22'))){_0x57f318[_0xf91b('0x9')]=qs['limit'](_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x9')]);_0x57f318[_0xf91b('0xb')]=qs[_0xf91b('0xb')](_0x50bc91['query']['offset']);}_0x57f318[_0xf91b('0x23')]=qs['sort'](_0x50bc91[_0xf91b('0x1e')]['sort']);_0x57f318['where']=qs['filters'](_[_0xf91b('0x24')](_0x50bc91[_0xf91b('0x1e')],_0x190a46[_0xf91b('0x25')]),_0x137c13);if(_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x26')]){_0x57f318['where']=_[_0xf91b('0x27')](_0x57f318[_0xf91b('0x28')],{'$or':_[_0xf91b('0x15')](_0x137c13,function(_0x5a0576){if(_0x5a0576[_0xf91b('0x19')]!==_0xf91b('0x29')){var _0xb5ba63={};_0xb5ba63[_0x5a0576[_0xf91b('0x12')]]={'$like':'%'+_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x26')]+'%'};return _0xb5ba63;}})});}_0x57f318=_[_0xf91b('0x27')]({},_0x57f318,_0x50bc91[_0xf91b('0x2a')]);var _0x39a815={'where':_0x57f318['where']};return db[_0xf91b('0x16')][_0xf91b('0xc')](_0x39a815)['then'](function(_0x273ca5){_0x18b8f0[_0xf91b('0xc')]=_0x273ca5;if(_0x50bc91[_0xf91b('0x1e')][_0xf91b('0x2b')]){_0x57f318[_0xf91b('0x2c')]=[{'all':!![]}];}return db[_0xf91b('0x16')]['findAll'](_0x57f318);})[_0xf91b('0x10')](function(_0x36cdca){_0x18b8f0[_0xf91b('0x2d')]=_['map'](_0x36cdca,function(_0x362064){if(_0x362064[_0xf91b('0x2e')]===_0xf91b('0x2f')){var _0x98861d=encryptor[_0xf91b('0x30')](_0x362064[_0xf91b('0x31')]);_0x362064[_0xf91b('0x31')]=maskClientSecret(_0x98861d);}return _0x362064;});return _0x18b8f0;})['then'](respondWithFilteredResult(_0x4148eb,_0x57f318))[_0xf91b('0x32')](handleError(_0x4148eb,null));};exports[_0xf91b('0x33')]=function(_0xde74e6,_0x1faf3d){var _0x47e297={'raw':!![],'where':{'id':_0xde74e6[_0xf91b('0x34')]['id']}},_0x1dfc05={};_0x1dfc05[_0xf91b('0x1b')]=_[_0xf91b('0x1c')](db['CloudProvider']['rawAttributes']);_0x1dfc05[_0xf91b('0x1e')]=_['keys'](_0xde74e6[_0xf91b('0x1e')]);_0x1dfc05[_0xf91b('0x25')]=_[_0xf91b('0x1d')](_0x1dfc05[_0xf91b('0x1b')],_0x1dfc05[_0xf91b('0x1e')]);_0x47e297['attributes']=_[_0xf91b('0x1d')](_0x1dfc05['model'],qs[_0xf91b('0x1f')](_0xde74e6[_0xf91b('0x1e')]['fields']));_0x47e297[_0xf91b('0x20')]=_0x47e297[_0xf91b('0x20')]['length']?_0x47e297['attributes']:_0x1dfc05[_0xf91b('0x1b')];if(_0xde74e6['query'][_0xf91b('0x2b')]){_0x47e297['include']=[{'all':!![]}];}_0x47e297=_['merge']({},_0x47e297,_0xde74e6[_0xf91b('0x2a')]);return db[_0xf91b('0x16')][_0xf91b('0x35')](_0x47e297)[_0xf91b('0x10')](handleEntityNotFound(_0x1faf3d,null))[_0xf91b('0x10')](function(_0x118aa6){if(_0x118aa6[_0xf91b('0x2e')]===_0xf91b('0x2f')){var _0x5abb99=encryptor[_0xf91b('0x30')](_0x118aa6[_0xf91b('0x31')]);_0x118aa6[_0xf91b('0x31')]=maskClientSecret(_0x5abb99);}return _0x118aa6;})['then'](respondWithResult(_0x1faf3d,null))[_0xf91b('0x32')](handleError(_0x1faf3d,null));};exports[_0xf91b('0x36')]=function(_0x5334af,_0xe5fc79){if(!_0x5334af[_0xf91b('0x37')][_0xf91b('0x12')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x5334af['body']['service'])throw new Error(_0xf91b('0x38'));var _0x22a2e0=db[_0xf91b('0x16')][_0xf91b('0x17')]['service'][_0xf91b('0x39')];if(!_0x22a2e0['includes'](_0x5334af['body'][_0xf91b('0x2e')]))throw new Error(_0xf91b('0x3a')+_0x22a2e0[_0xf91b('0x3b')](',\x20'));if(_0x5334af['body'][_0xf91b('0x2e')]===_0xf91b('0x2f')&&_0x5334af['body'][_0xf91b('0x31')]){_0x5334af['body'][_0xf91b('0x31')]=encryptor[_0xf91b('0x3c')](_0x5334af[_0xf91b('0x37')][_0xf91b('0x31')]);}return db[_0xf91b('0x16')][_0xf91b('0x36')](_0x5334af[_0xf91b('0x37')],{})['then'](respondWithResult(_0xe5fc79,0xc9))[_0xf91b('0x32')](handleError(_0xe5fc79,null));};exports[_0xf91b('0x3d')]=function(_0x7365ef,_0x533863){if(_0x7365ef[_0xf91b('0x37')]['id']){delete _0x7365ef[_0xf91b('0x37')]['id'];}return db[_0xf91b('0x16')]['find']({'where':{'id':_0x7365ef[_0xf91b('0x34')]['id']}})[_0xf91b('0x10')](handleEntityNotFound(_0x533863,null))[_0xf91b('0x10')](function(_0x1c46b9){if(_0x1c46b9[_0xf91b('0x2e')]==='MicrosoftAzure'&&_0x7365ef[_0xf91b('0x37')][_0xf91b('0x31')]){_0x7365ef[_0xf91b('0x37')][_0xf91b('0x31')]=encryptor['encryptString'](_0x7365ef['body'][_0xf91b('0x31')]);}return _0x1c46b9;})['then'](saveUpdates(_0x7365ef['body'],null))[_0xf91b('0x10')](respondWithResult(_0x533863,null))['catch'](handleError(_0x533863,null));};exports[_0xf91b('0x3e')]=function(_0x1431f1,_0x54fb2f){return db['CloudProvider'][_0xf91b('0x35')]({'where':{'id':_0x1431f1[_0xf91b('0x34')]['id']}})[_0xf91b('0x10')](handleEntityNotFound(_0x54fb2f,null))[_0xf91b('0x10')](removeEntity(_0x54fb2f,null))['catch'](handleError(_0x54fb2f,null));};exports[_0xf91b('0x3f')]=function(_0x29593e,_0x463667){return db[_0xf91b('0x16')][_0xf91b('0x40')]({'where':{'id':_0x29593e[_0xf91b('0x34')]['id']},'raw':!![]})[_0xf91b('0x10')](function(_0x2aab02){if(!_0x2aab02)return _0x463667[_0xf91b('0x8')](0x194);return{'url':oauth[_0xf91b('0x41')](_0x2aab02,_0x29593e[_0xf91b('0x42')]['id'])};})[_0xf91b('0x10')](respondWithResult(_0x463667,null))[_0xf91b('0x32')](handleError(_0x463667,null));};exports[_0xf91b('0x43')]=function(_0x57b10b,_0x4f031b){var _0x20ab7f=_0x57b10b[_0xf91b('0x37')];var _0x155563;var _0x2b5e2b;if(_0x20ab7f[_0xf91b('0x11')])throw _0x20ab7f;redis[_0xf91b('0x44')](_0x20ab7f[_0xf91b('0x45')])[_0xf91b('0x10')](function(_0xbf7133){if(!_0xbf7133)throw new Error(_0xf91b('0x46'));_0x155563=JSON[_0xf91b('0x47')](_0xbf7133);var _0x40edaa=Buffer[_0xf91b('0x48')](_0x20ab7f[_0xf91b('0x45')],_0xf91b('0x49'))['toString'](_0xf91b('0x4a'));_0x2b5e2b=JSON[_0xf91b('0x47')](_0x40edaa);if(!oauth['isValidIdToken'](_0x20ab7f[_0xf91b('0x4b')],_0x155563[_0xf91b('0x4c')]))throw new Error(_0xf91b('0x4d'));redis[_0xf91b('0x4e')](_0x20ab7f[_0xf91b('0x45')]);return oauth[_0xf91b('0x4f')](_0x20ab7f['code'],_0x155563);})['then'](function(_0x54b8b6){_0x155563[_0xf91b('0x50')]=_0x54b8b6[_0xf91b('0x51')];_0x155563['data6']=_0x54b8b6[_0xf91b('0x52')];return db[_0xf91b('0x16')][_0xf91b('0x3d')]({'data5':_0x155563[_0xf91b('0x50')],'data6':_0x155563['data6']},{'where':{'id':_0x155563['id']}});})[_0xf91b('0x10')](function(){oauth[_0xf91b('0x53')](_0x155563);socket[_0xf91b('0x54')](_0xf91b('0x55'),{'id':_0x2b5e2b['id']});return;})['then'](respondWithStatusCode(_0x4f031b,null))[_0xf91b('0x32')](function(_0x2a20c0){if(_0x2b5e2b){socket[_0xf91b('0x54')](_0xf91b('0x56'),{'id':_0x2b5e2b['id']});}if(!_0x155563){logger[_0xf91b('0x11')](_0xf91b('0x57'),_0x2a20c0);return _0x4f031b[_0xf91b('0xd')](0x1f4)[_0xf91b('0x58')](_0x2a20c0[_0xf91b('0x59')]);}logger['error'](_0xf91b('0x5a'),_0x155563['id'],JSON[_0xf91b('0x5b')](_0x2a20c0));});};
\ No newline at end of file
+var _0xeccd=['update','then','sendStatus','error','stack','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','stringify','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x2c1e14,_0x4680db){var _0x1a12b1=function(_0x3fdaec){while(--_0x3fdaec){_0x2c1e14['push'](_0x2c1e14['shift']());}};_0x1a12b1(++_0x4680db);}(_0xeccd,0x100));var _0xdecc=function(_0x351521,_0x2b9971){_0x351521=_0x351521-0x0;var _0x8bfb3a=_0xeccd[_0x351521];return _0x8bfb3a;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xdecc('0x0'));var encryptor=require('../../components/encryptor');var config=require(_0xdecc('0x1'));var logger=require(_0xdecc('0x2'))(_0xdecc('0x3'));var db=require(_0xdecc('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xdecc('0x5')]=_[_0xdecc('0x6')](config[_0xdecc('0x5')],{'host':_0xdecc('0x7'),'port':0x18eb});var socket=require(_0xdecc('0x8'))(new Redis(config[_0xdecc('0x5')]));var redis=new Redis(config[_0xdecc('0x5')]);function respondWithStatusCode(_0xf26e93,_0x4c3c20){_0x4c3c20=_0x4c3c20||0xcc;return function(_0xe7e34b){if(_0xe7e34b){return _0xf26e93['sendStatus'](_0x4c3c20);}return _0xf26e93[_0xdecc('0x9')](_0x4c3c20)[_0xdecc('0xa')]();};}function respondWithResult(_0x42fcc0,_0x55637b){_0x55637b=_0x55637b||0xc8;return function(_0x230799){if(_0x230799){return _0x42fcc0[_0xdecc('0x9')](_0x55637b)[_0xdecc('0xb')](_0x230799);}};}function respondWithFilteredResult(_0xbda0ae,_0x407a5a){return function(_0xa37f1c){if(_0xa37f1c){var _0x2300f1=typeof _0x407a5a[_0xdecc('0xc')]==='undefined'&&typeof _0x407a5a[_0xdecc('0xd')]===_0xdecc('0xe');var _0xbf66aa=_0xa37f1c[_0xdecc('0xf')];var _0x800900=_0x2300f1?0x0:_0x407a5a[_0xdecc('0xc')];var _0x1fd48b=_0x2300f1?_0xa37f1c[_0xdecc('0xf')]:_0x407a5a['offset']+_0x407a5a[_0xdecc('0xd')];var _0x586ccd;if(_0x1fd48b>=_0xbf66aa){_0x1fd48b=_0xbf66aa;_0x586ccd=0xc8;}else{_0x586ccd=0xce;}_0xbda0ae[_0xdecc('0x9')](_0x586ccd);return _0xbda0ae['set'](_0xdecc('0x10'),_0x800900+'-'+_0x1fd48b+'/'+_0xbf66aa)[_0xdecc('0xb')](_0xa37f1c);}return null;};}function saveUpdates(_0x5aebc5){return function(_0x4edaa5){if(_0x4edaa5){return _0x4edaa5[_0xdecc('0x11')](_0x5aebc5)[_0xdecc('0x12')](function(_0x3febc8){return _0x3febc8;});}return null;};}function removeEntity(_0x1c962f){return function(_0x3349c5){if(_0x3349c5){return _0x3349c5['destroy']()[_0xdecc('0x12')](function(){_0x1c962f[_0xdecc('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce6e3){return function(_0x45bcc7){if(!_0x45bcc7){_0x1ce6e3[_0xdecc('0x13')](0x194);}return _0x45bcc7;};}function handleError(_0x557f2c,_0x45affc){_0x45affc=_0x45affc||0x1f4;return function(_0x5df811){logger[_0xdecc('0x14')](_0x5df811[_0xdecc('0x15')]);if(_0x5df811[_0xdecc('0x16')]){delete _0x5df811[_0xdecc('0x16')];}_0x557f2c[_0xdecc('0x9')](_0x45affc)['send'](_0x5df811);};}function maskClientSecret(_0x337b12){return _['padEnd'](_0x337b12[_0xdecc('0x17')](0x0,0x3),0x14,'*');}exports[_0xdecc('0x18')]=function(_0x100d9a,_0x29b03c){var _0x14c272={},_0x4c7772={},_0xea53c2={'count':0x0,'rows':[]};var _0x568552=_[_0xdecc('0x19')](db[_0xdecc('0x1a')][_0xdecc('0x1b')],function(_0x578a3d){return{'name':_0x578a3d[_0xdecc('0x1c')],'type':_0x578a3d[_0xdecc('0x1d')]['key']};});_0x4c7772[_0xdecc('0x1e')]=_[_0xdecc('0x19')](_0x568552,'name');_0x4c7772['query']=_[_0xdecc('0x1f')](_0x100d9a[_0xdecc('0x20')]);_0x4c7772[_0xdecc('0x21')]=_[_0xdecc('0x22')](_0x4c7772['model'],_0x4c7772[_0xdecc('0x20')]);_0x14c272[_0xdecc('0x23')]=_[_0xdecc('0x22')](_0x4c7772['model'],qs[_0xdecc('0x24')](_0x100d9a['query']['fields']));_0x14c272[_0xdecc('0x23')]=_0x14c272[_0xdecc('0x23')]['length']?_0x14c272[_0xdecc('0x23')]:_0x4c7772[_0xdecc('0x1e')];if(!_0x100d9a[_0xdecc('0x20')]['hasOwnProperty'](_0xdecc('0x25'))){_0x14c272[_0xdecc('0xd')]=qs[_0xdecc('0xd')](_0x100d9a[_0xdecc('0x20')][_0xdecc('0xd')]);_0x14c272[_0xdecc('0xc')]=qs[_0xdecc('0xc')](_0x100d9a[_0xdecc('0x20')][_0xdecc('0xc')]);}_0x14c272[_0xdecc('0x26')]=qs[_0xdecc('0x27')](_0x100d9a['query'][_0xdecc('0x27')]);_0x14c272[_0xdecc('0x28')]=qs['filters'](_['pick'](_0x100d9a['query'],_0x4c7772['filters']),_0x568552);if(_0x100d9a[_0xdecc('0x20')][_0xdecc('0x29')]){_0x14c272[_0xdecc('0x28')]=_[_0xdecc('0x2a')](_0x14c272[_0xdecc('0x28')],{'$or':_[_0xdecc('0x19')](_0x568552,function(_0x40923a){if(_0x40923a['type']!==_0xdecc('0x2b')){var _0x451ce3={};_0x451ce3[_0x40923a[_0xdecc('0x16')]]={'$like':'%'+_0x100d9a['query'][_0xdecc('0x29')]+'%'};return _0x451ce3;}})});}_0x14c272=_[_0xdecc('0x2a')]({},_0x14c272,_0x100d9a['options']);var _0x50f833={'where':_0x14c272[_0xdecc('0x28')]};return db['CloudProvider'][_0xdecc('0xf')](_0x50f833)[_0xdecc('0x12')](function(_0x902fa7){_0xea53c2[_0xdecc('0xf')]=_0x902fa7;if(_0x100d9a['query']['includeAll']){_0x14c272[_0xdecc('0x2c')]=[{'all':!![]}];}return db[_0xdecc('0x1a')][_0xdecc('0x2d')](_0x14c272);})[_0xdecc('0x12')](function(_0x18a3b6){_0xea53c2['rows']=_[_0xdecc('0x19')](_0x18a3b6,function(_0x3fabe3){if(_0x3fabe3[_0xdecc('0x2e')]===_0xdecc('0x2f')){var _0x3afb4b=encryptor[_0xdecc('0x30')](_0x3fabe3[_0xdecc('0x31')]);_0x3fabe3[_0xdecc('0x31')]=maskClientSecret(_0x3afb4b);}return _0x3fabe3;});return _0xea53c2;})[_0xdecc('0x12')](respondWithFilteredResult(_0x29b03c,_0x14c272))[_0xdecc('0x32')](handleError(_0x29b03c,null));};exports[_0xdecc('0x33')]=function(_0x3a0bf2,_0x117ef0){var _0x5c4c96={'raw':!![],'where':{'id':_0x3a0bf2[_0xdecc('0x34')]['id']}},_0x589e34={};_0x589e34[_0xdecc('0x1e')]=_[_0xdecc('0x1f')](db[_0xdecc('0x1a')][_0xdecc('0x1b')]);_0x589e34[_0xdecc('0x20')]=_[_0xdecc('0x1f')](_0x3a0bf2['query']);_0x589e34[_0xdecc('0x21')]=_[_0xdecc('0x22')](_0x589e34['model'],_0x589e34[_0xdecc('0x20')]);_0x5c4c96[_0xdecc('0x23')]=_[_0xdecc('0x22')](_0x589e34[_0xdecc('0x1e')],qs[_0xdecc('0x24')](_0x3a0bf2[_0xdecc('0x20')][_0xdecc('0x24')]));_0x5c4c96[_0xdecc('0x23')]=_0x5c4c96['attributes']['length']?_0x5c4c96[_0xdecc('0x23')]:_0x589e34[_0xdecc('0x1e')];if(_0x3a0bf2[_0xdecc('0x20')]['includeAll']){_0x5c4c96[_0xdecc('0x2c')]=[{'all':!![]}];}_0x5c4c96=_['merge']({},_0x5c4c96,_0x3a0bf2[_0xdecc('0x35')]);return db[_0xdecc('0x1a')][_0xdecc('0x36')](_0x5c4c96)[_0xdecc('0x12')](handleEntityNotFound(_0x117ef0,null))[_0xdecc('0x12')](function(_0x14eea1){if(_0x14eea1['service']===_0xdecc('0x2f')){var _0x1b41fa=encryptor[_0xdecc('0x30')](_0x14eea1[_0xdecc('0x31')]);_0x14eea1['data3']=maskClientSecret(_0x1b41fa);}return _0x14eea1;})['then'](respondWithResult(_0x117ef0,null))[_0xdecc('0x32')](handleError(_0x117ef0,null));};exports[_0xdecc('0x37')]=function(_0x4750a6,_0x57f2b3){if(!_0x4750a6[_0xdecc('0x38')][_0xdecc('0x16')])throw new Error(_0xdecc('0x39'));if(!_0x4750a6[_0xdecc('0x38')][_0xdecc('0x2e')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4494a5=db[_0xdecc('0x1a')][_0xdecc('0x1b')][_0xdecc('0x2e')]['values'];if(!_0x4494a5[_0xdecc('0x3a')](_0x4750a6[_0xdecc('0x38')][_0xdecc('0x2e')]))throw new Error(_0xdecc('0x3b')+_0x4494a5[_0xdecc('0x3c')](',\x20'));if(_0x4750a6[_0xdecc('0x38')]['service']===_0xdecc('0x2f')&&_0x4750a6[_0xdecc('0x38')][_0xdecc('0x31')]){_0x4750a6['body']['data3']=encryptor[_0xdecc('0x3d')](_0x4750a6[_0xdecc('0x38')][_0xdecc('0x31')]);}return db[_0xdecc('0x1a')]['create'](_0x4750a6[_0xdecc('0x38')],{})[_0xdecc('0x12')](respondWithResult(_0x57f2b3,0xc9))[_0xdecc('0x32')](handleError(_0x57f2b3,null));};exports[_0xdecc('0x11')]=function(_0x24b566,_0x43a227){if(_0x24b566[_0xdecc('0x38')]['id']){delete _0x24b566[_0xdecc('0x38')]['id'];}return db[_0xdecc('0x1a')][_0xdecc('0x36')]({'where':{'id':_0x24b566[_0xdecc('0x34')]['id']}})['then'](handleEntityNotFound(_0x43a227,null))[_0xdecc('0x12')](function(_0x3498e0){if(_0x3498e0[_0xdecc('0x2e')]==='MicrosoftAzure'&&_0x24b566[_0xdecc('0x38')][_0xdecc('0x31')]){_0x24b566[_0xdecc('0x38')][_0xdecc('0x31')]=encryptor[_0xdecc('0x3d')](_0x24b566[_0xdecc('0x38')]['data3']);}return _0x3498e0;})[_0xdecc('0x12')](saveUpdates(_0x24b566[_0xdecc('0x38')],null))['then'](respondWithResult(_0x43a227,null))[_0xdecc('0x32')](handleError(_0x43a227,null));};exports[_0xdecc('0x3e')]=function(_0x46512a,_0x12195b){return db[_0xdecc('0x1a')][_0xdecc('0x36')]({'where':{'id':_0x46512a[_0xdecc('0x34')]['id']}})[_0xdecc('0x12')](handleEntityNotFound(_0x12195b,null))[_0xdecc('0x12')](removeEntity(_0x12195b,null))[_0xdecc('0x32')](handleError(_0x12195b,null));};exports['oauth2MicrosoftAuthorize']=function(_0x554fa0,_0x43d6a2){return db[_0xdecc('0x1a')][_0xdecc('0x3f')]({'where':{'id':_0x554fa0['params']['id']},'raw':!![]})[_0xdecc('0x12')](function(_0x47db8d){if(!_0x47db8d)return _0x43d6a2[_0xdecc('0x13')](0x194);return{'url':oauth[_0xdecc('0x40')](_0x47db8d,_0x554fa0[_0xdecc('0x41')]['id'])};})[_0xdecc('0x12')](respondWithResult(_0x43d6a2,null))[_0xdecc('0x32')](handleError(_0x43d6a2,null));};exports[_0xdecc('0x42')]=function(_0x4405f3,_0x514e9e){var _0x5cc12d=_0x4405f3[_0xdecc('0x38')];var _0x3d6ec2;var _0x3598c7;if(_0x5cc12d['error'])throw _0x5cc12d;redis[_0xdecc('0x43')](_0x5cc12d[_0xdecc('0x44')])['then'](function(_0x38e123){if(!_0x38e123)throw new Error(_0xdecc('0x45'));_0x3d6ec2=JSON['parse'](_0x38e123);var _0x12dea9=Buffer[_0xdecc('0x46')](_0x5cc12d[_0xdecc('0x44')],_0xdecc('0x47'))[_0xdecc('0x48')](_0xdecc('0x49'));_0x3598c7=JSON[_0xdecc('0x4a')](_0x12dea9);if(!oauth[_0xdecc('0x4b')](_0x5cc12d[_0xdecc('0x4c')],_0x3d6ec2[_0xdecc('0x4d')]))throw new Error(_0xdecc('0x4e'));redis[_0xdecc('0x4f')](_0x5cc12d['state']);return oauth[_0xdecc('0x50')](_0x5cc12d[_0xdecc('0x51')],_0x3d6ec2);})[_0xdecc('0x12')](function(_0x19063d){_0x3d6ec2[_0xdecc('0x52')]=_0x19063d[_0xdecc('0x53')];_0x3d6ec2[_0xdecc('0x54')]=_0x19063d['refresh_token'];return db[_0xdecc('0x1a')][_0xdecc('0x11')]({'data5':_0x3d6ec2[_0xdecc('0x52')],'data6':_0x3d6ec2[_0xdecc('0x54')]},{'where':{'id':_0x3d6ec2['id']}});})[_0xdecc('0x12')](function(){oauth['startRefreshInterval'](_0x3d6ec2);socket['emit'](_0xdecc('0x55'),{'id':_0x3598c7['id']});return;})[_0xdecc('0x12')](respondWithStatusCode(_0x514e9e,null))['catch'](function(_0x53803f){if(_0x3598c7){socket['emit'](_0xdecc('0x56'),{'id':_0x3598c7['id']});}if(!_0x3d6ec2){logger['error'](_0xdecc('0x57'),_0x53803f);return _0x514e9e[_0xdecc('0x9')](0x1f4)[_0xdecc('0x58')](_0x53803f[_0xdecc('0x59')]);}logger[_0xdecc('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x3d6ec2['id'],JSON[_0xdecc('0x5a')](_0x53803f));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index b203627..6d5302b 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9974=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','./cloudProvider.attributes','cloud_providers'];(function(_0x45799a,_0x203d8d){var _0x20b234=function(_0x3faf51){while(--_0x3faf51){_0x45799a['push'](_0x45799a['shift']());}};_0x20b234(++_0x203d8d);}(_0x9974,0x168));var _0x4997=function(_0x4f602f,_0x5a0e14){_0x4f602f=_0x4f602f-0x0;var _0x79cf8b=_0x9974[_0x4f602f];return _0x79cf8b;};'use strict';var _=require(_0x4997('0x0'));var util=require(_0x4997('0x1'));var logger=require(_0x4997('0x2'))('api');var moment=require(_0x4997('0x3'));var BPromise=require('bluebird');var rp=require(_0x4997('0x4'));var fs=require('fs');var path=require(_0x4997('0x5'));var rimraf=require(_0x4997('0x6'));var config=require('../../config/environment');var attributes=require(_0x4997('0x7'));module['exports']=function(_0x2bb3dd,_0x2d358d){return _0x2bb3dd['define']('CloudProvider',attributes,{'tableName':_0x4997('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc088=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','../../config/logger','api'];(function(_0xe6c803,_0x484b8c){var _0x588402=function(_0x552eaf){while(--_0x552eaf){_0xe6c803['push'](_0xe6c803['shift']());}};_0x588402(++_0x484b8c);}(_0xc088,0x1b6));var _0x8c08=function(_0x2df23d,_0x4b03b0){_0x2df23d=_0x2df23d-0x0;var _0x5d499a=_0xc088[_0x2df23d];return _0x5d499a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c08('0x0'))(_0x8c08('0x1'));var moment=require(_0x8c08('0x2'));var BPromise=require(_0x8c08('0x3'));var rp=require(_0x8c08('0x4'));var fs=require('fs');var path=require(_0x8c08('0x5'));var rimraf=require(_0x8c08('0x6'));var config=require(_0x8c08('0x7'));var attributes=require(_0x8c08('0x8'));module['exports']=function(_0x59add9,_0x5cfd7f){return _0x59add9[_0x8c08('0x9')]('CloudProvider',attributes,{'tableName':_0x8c08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 7d0fb1a..d1fa9c6 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x69cb=['data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','state','nonce','prompt','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','{TENANT_ID}','access_token','update','data5','data6','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','openid','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace'];(function(_0x43026d,_0x4d8576){var _0x313e6d=function(_0x3d6a35){while(--_0x3d6a35){_0x43026d['push'](_0x43026d['shift']());}};_0x313e6d(++_0x4d8576);}(_0x69cb,0xd5));var _0xb69c=function(_0x861e02,_0x33f772){_0x861e02=_0x861e02-0x0;var _0x48fc24=_0x69cb[_0x861e02];return _0x48fc24;};'use strict';var _=require(_0xb69c('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xb69c('0x1'));var Redis=require('ioredis');var rp=require(_0xb69c('0x2'));var util=require('util');var encryptor=require(_0xb69c('0x3'));var config=require(_0xb69c('0x4'));var logger=require(_0xb69c('0x5'))(_0xb69c('0x6'));var schedule=require(_0xb69c('0x7'));var db=require(_0xb69c('0x8'))['db'];config[_0xb69c('0x9')]=_[_0xb69c('0xa')](config[_0xb69c('0x9')],{'host':_0xb69c('0xb'),'port':0x18eb});var redis=new Redis(config[_0xb69c('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xb69c('0xc'),'email',_0xb69c('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xb69c('0xe'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xb69c('0xf'),_0xb69c('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xb69c('0x10');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4ffac0){var _0x3c06c2=_[_0xb69c('0x11')](AZURE_AUTH_SCOPES[_0x4ffac0[_0xb69c('0x12')]]);if(_0x4ffac0['type']===_0xb69c('0x13'))_0x3c06c2[_0xb69c('0x14')](_0x4ffac0[_0xb69c('0x15')]+_0xb69c('0x16'));return _0x3c06c2[_0xb69c('0x17')]('\x20');}function getAccessTokenScope(_0x547fa2){if(_0x547fa2['type']===_0xb69c('0x18'))return _0xb69c('0x19');if(_0x547fa2[_0xb69c('0x12')]===_0xb69c('0x13'))return _0x547fa2[_0xb69c('0x15')]+_0xb69c('0x16');}function generateMicrosoftAuthorizationUrl(_0x2c2ac1,_0x2c1329){var _0x67b459=MICROSOFT_AUTH_URL[_0xb69c('0x1a')]('{TENANT_ID}',_0x2c2ac1[_0xb69c('0x1b')]);var _0x1c29cb=[_0xb69c('0x1c'),_0xb69c('0x1d')];var _0x581c83=Buffer[_0xb69c('0x1e')](JSON[_0xb69c('0x1f')]({'id':_0x2c1329}))[_0xb69c('0x20')](_0xb69c('0x21'));var _0x44ca5e=crypto[_0xb69c('0x22')](0x10)[_0xb69c('0x20')](_0xb69c('0x23'));var _0x3bec85=getAuthorizationScopes(_0x2c2ac1);var _0x18e26f=[{'key':_0xb69c('0x24'),'value':_0x2c2ac1[_0xb69c('0x25')]},{'key':_0xb69c('0x26'),'value':encodeURIComponent(_0x1c29cb['join']('\x20'))},{'key':_0xb69c('0x27'),'value':_0x2c2ac1[_0xb69c('0x28')]},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x3bec85)},{'key':_0xb69c('0x29'),'value':_0x581c83},{'key':_0xb69c('0x2a'),'value':_0x44ca5e},{'key':_0xb69c('0x2b'),'value':'login'}];var _0x2f490c=_0x67b459+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb69c('0x11')](_0x18e26f,function(_0x3093c5){return _0x3093c5[_0xb69c('0x2c')]+'='+_0x3093c5[_0xb69c('0x2d')];})[_0xb69c('0x17')]('&');_0x2c2ac1[_0xb69c('0x2e')]={'issuer':_0x67b459[_0xb69c('0x1a')](_0xb69c('0x2f'),''),'audience':_0x2c2ac1[_0xb69c('0x25')],'state':_0x581c83,'nonce':_0x44ca5e};redis['set'](_0x581c83,JSON['stringify'](_0x2c2ac1));return _0x2f490c;}function isValidIdToken(_0x16c0dc,_0x26f825){try{var _0x260d1b=jwt[_0xb69c('0x30')](_0x16c0dc,{'complete':!![]});var _0x1408d7=_0x260d1b[_0xb69c('0x31')];if(_0x1408d7[_0xb69c('0x32')]!==_0x26f825[_0xb69c('0x33')])return![];if(_0x1408d7[_0xb69c('0x34')]!==_0x26f825[_0xb69c('0x35')])return![];if(_0x1408d7['nonce']!==_0x26f825[_0xb69c('0x2a')])return![];if(moment()[_0xb69c('0x36')](moment[_0xb69c('0x37')](_0x1408d7[_0xb69c('0x38')])))return![];return!![];}catch(_0x2a6bc8){throw _0x2a6bc8;}}function refreshOauth2MicrosoftAccessToken(_0x311852){return Promise[_0xb69c('0x39')]()[_0xb69c('0x3a')](function(){if(_0x311852[_0xb69c('0x3b')])return _0x311852;return db[_0xb69c('0x3c')][_0xb69c('0x3d')]({'where':{'id':_0x311852['id']},'raw':!![]});})['then'](function(_0x5e577c){var _0x4f4d2a={'grant_type':_0xb69c('0x3e'),'refresh_token':_0x5e577c['data6'],'scope':getAccessTokenScope(_0x5e577c),'redirect_uri':_0x5e577c[_0xb69c('0x28')],'client_id':_0x5e577c['data1'],'client_secret':encryptor[_0xb69c('0x3f')](_0x5e577c[_0xb69c('0x3b')])};var _0x54ca73={'method':_0xb69c('0x40'),'uri':MICROSOFT_AUTH_URL[_0xb69c('0x1a')](_0xb69c('0x41'),_0x5e577c[_0xb69c('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f4d2a,'json':!![]};return rp(_0x54ca73);})[_0xb69c('0x3a')](function(_0x71e8b4){_0x311852['data5']=_0x71e8b4[_0xb69c('0x42')];_0x311852['data6']=_0x71e8b4['refresh_token'];return db['CloudProvider'][_0xb69c('0x43')]({'data5':_0x311852[_0xb69c('0x44')],'data6':_0x311852[_0xb69c('0x45')]},{'where':{'id':_0x311852['id']}});})[_0xb69c('0x3a')](function(){return _0x311852;})[_0xb69c('0x46')](function(_0x78437b){logger['error'](_0xb69c('0x47'),_0x311852['id'],_0x78437b);});}function getOauth2MicrosoftAccessToken(_0x5826eb,_0x4dfe7b){var _0x1413e4={'grant_type':'authorization_code','code':_0x5826eb,'scope':getAccessTokenScope(_0x4dfe7b),'redirect_uri':_0x4dfe7b[_0xb69c('0x28')],'client_id':_0x4dfe7b[_0xb69c('0x25')],'client_secret':encryptor['decryptString'](_0x4dfe7b[_0xb69c('0x3b')])};var _0x515270={'method':_0xb69c('0x40'),'uri':MICROSOFT_AUTH_URL[_0xb69c('0x1a')](_0xb69c('0x41'),_0x4dfe7b[_0xb69c('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1413e4,'json':!![]};return rp(_0x515270);}function startRefreshInterval(_0x4fb358){var _0x55a616=schedule[_0xb69c('0x48')];if(_0x55a616[_0x4fb358['id']])clearInterval(_0x55a616[_0x4fb358['id']]);_0x55a616[_0x4fb358['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb69c('0x49')](this,{'id':_0x4fb358['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x55a616;}function startAllRefreshIntervals(){return db[_0xb69c('0x3c')][_0xb69c('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x51759a){var _0x4ab598=_0x51759a[_0xb69c('0x11')](function(_0x19d615){return refreshOauth2MicrosoftAccessToken(_0x19d615)[_0xb69c('0x3a')](function(_0x50b5b9){startRefreshInterval(_0x50b5b9);});});return Promise[_0xb69c('0x4b')](_0x4ab598);})[_0xb69c('0x46')](function(_0xcb0e3d){var _0x9f1658=_0xcb0e3d?util[_0xb69c('0x4c')](_0xcb0e3d,{'showHidden':![],'depth':null}):'';logger[_0xb69c('0x4d')](_0xb69c('0x4e'),_0x9f1658);});}module[_0xb69c('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x351b=['openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','map','type','Dynamics365','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','{TENANT_ID}','data2','id_token','from','stringify','randomBytes','toString','hex','client_id','data1','join','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','POST','data5','access_token','CloudProvider','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data4','decryptString','intervals','bind','all','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost'];(function(_0x49d522,_0x1292c3){var _0x5ca1d9=function(_0x274351){while(--_0x274351){_0x49d522['push'](_0x49d522['shift']());}};_0x5ca1d9(++_0x1292c3);}(_0x351b,0x91));var _0xb351=function(_0x3be6fb,_0x18fd31){_0x3be6fb=_0x3be6fb-0x0;var _0x4ba854=_0x351b[_0x3be6fb];return _0x4ba854;};'use strict';var _=require(_0xb351('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xb351('0x1'));var Redis=require(_0xb351('0x2'));var rp=require(_0xb351('0x3'));var util=require(_0xb351('0x4'));var encryptor=require(_0xb351('0x5'));var config=require(_0xb351('0x6'));var logger=require(_0xb351('0x7'))(_0xb351('0x8'));var schedule=require(_0xb351('0x9'));var db=require(_0xb351('0xa'))['db'];config[_0xb351('0xb')]=_['defaults'](config[_0xb351('0xb')],{'host':_0xb351('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xb351('0xd'),_0xb351('0xe'),_0xb351('0xf'),_0xb351('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xb351('0x11')],'Dynamics365':[_0xb351('0xd'),_0xb351('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x10a203){var _0x30a1b6=_[_0xb351('0x12')](AZURE_AUTH_SCOPES[_0x10a203[_0xb351('0x13')]]);if(_0x10a203['type']===_0xb351('0x14'))_0x30a1b6['push'](_0x10a203[_0xb351('0x15')]+_0xb351('0x16'));return _0x30a1b6['join']('\x20');}function getAccessTokenScope(_0x27d9b0){if(_0x27d9b0[_0xb351('0x13')]===_0xb351('0x17'))return _0xb351('0x18');if(_0x27d9b0[_0xb351('0x13')]===_0xb351('0x14'))return _0x27d9b0[_0xb351('0x15')]+_0xb351('0x16');}function generateMicrosoftAuthorizationUrl(_0x3f2cec,_0x14450d){var _0x82029e=MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x3f2cec[_0xb351('0x1a')]);var _0x2e6ec7=['code',_0xb351('0x1b')];var _0x50cf72=Buffer[_0xb351('0x1c')](JSON[_0xb351('0x1d')]({'id':_0x14450d}))['toString']('base64');var _0x4ba651=crypto[_0xb351('0x1e')](0x10)[_0xb351('0x1f')](_0xb351('0x20'));var _0x408381=getAuthorizationScopes(_0x3f2cec);var _0x5c8394=[{'key':_0xb351('0x21'),'value':_0x3f2cec[_0xb351('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x2e6ec7[_0xb351('0x23')]('\x20'))},{'key':_0xb351('0x24'),'value':_0x3f2cec['data4']},{'key':_0xb351('0x25'),'value':_0xb351('0x26')},{'key':_0xb351('0x27'),'value':encodeURIComponent(_0x408381)},{'key':_0xb351('0x28'),'value':_0x50cf72},{'key':_0xb351('0x29'),'value':_0x4ba651},{'key':_0xb351('0x2a'),'value':'login'}];var _0x5229b7=_0x82029e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x5c8394,function(_0x4a1752){return _0x4a1752[_0xb351('0x2b')]+'='+_0x4a1752[_0xb351('0x2c')];})[_0xb351('0x23')]('&');_0x3f2cec[_0xb351('0x2d')]={'issuer':_0x82029e[_0xb351('0x2e')](_0xb351('0x2f'),''),'audience':_0x3f2cec['data1'],'state':_0x50cf72,'nonce':_0x4ba651};redis[_0xb351('0x30')](_0x50cf72,JSON[_0xb351('0x1d')](_0x3f2cec));return _0x5229b7;}function isValidIdToken(_0x3fda14,_0xdbad99){try{var _0x24093f=jwt[_0xb351('0x31')](_0x3fda14,{'complete':!![]});var _0x4240ca=_0x24093f[_0xb351('0x32')];if(_0x4240ca[_0xb351('0x33')]!==_0xdbad99[_0xb351('0x34')])return![];if(_0x4240ca[_0xb351('0x35')]!==_0xdbad99[_0xb351('0x36')])return![];if(_0x4240ca['nonce']!==_0xdbad99[_0xb351('0x29')])return![];if(moment()[_0xb351('0x37')](moment[_0xb351('0x38')](_0x4240ca[_0xb351('0x39')])))return![];return!![];}catch(_0x2c30d8){throw _0x2c30d8;}}function refreshOauth2MicrosoftAccessToken(_0x229eda){return Promise[_0xb351('0x3a')]()[_0xb351('0x3b')](function(){if(_0x229eda[_0xb351('0x3c')])return _0x229eda;return db['CloudProvider'][_0xb351('0x3d')]({'where':{'id':_0x229eda['id']},'raw':!![]});})['then'](function(_0x2ca782){var _0x3e71d4={'grant_type':_0xb351('0x3e'),'refresh_token':_0x2ca782[_0xb351('0x3f')],'scope':getAccessTokenScope(_0x2ca782),'redirect_uri':_0x2ca782['data4'],'client_id':_0x2ca782[_0xb351('0x22')],'client_secret':encryptor['decryptString'](_0x2ca782[_0xb351('0x3c')])};var _0x380fcd={'method':_0xb351('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x2ca782[_0xb351('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3e71d4,'json':!![]};return rp(_0x380fcd);})[_0xb351('0x3b')](function(_0x32bb37){_0x229eda[_0xb351('0x41')]=_0x32bb37[_0xb351('0x42')];_0x229eda[_0xb351('0x3f')]=_0x32bb37[_0xb351('0x3e')];return db[_0xb351('0x43')][_0xb351('0x44')]({'data5':_0x229eda[_0xb351('0x41')],'data6':_0x229eda[_0xb351('0x3f')]},{'where':{'id':_0x229eda['id']}});})[_0xb351('0x3b')](function(){return _0x229eda;})['catch'](function(_0x8636a9){logger['error'](_0xb351('0x45'),_0x229eda['id'],_0x8636a9);});}function getOauth2MicrosoftAccessToken(_0x54a597,_0x1e31cb){var _0x2352af={'grant_type':'authorization_code','code':_0x54a597,'scope':getAccessTokenScope(_0x1e31cb),'redirect_uri':_0x1e31cb[_0xb351('0x46')],'client_id':_0x1e31cb[_0xb351('0x22')],'client_secret':encryptor[_0xb351('0x47')](_0x1e31cb[_0xb351('0x3c')])};var _0x396932={'method':_0xb351('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x1e31cb[_0xb351('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2352af,'json':!![]};return rp(_0x396932);}function startRefreshInterval(_0x3941ed){var _0x5ca9eb=schedule[_0xb351('0x48')];if(_0x5ca9eb[_0x3941ed['id']])clearInterval(_0x5ca9eb[_0x3941ed['id']]);_0x5ca9eb[_0x3941ed['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb351('0x49')](this,{'id':_0x3941ed['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb351('0x48')]=_0x5ca9eb;}function startAllRefreshIntervals(){return db[_0xb351('0x43')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb351('0x3b')](function(_0xf4b05f){var _0xa36155=_0xf4b05f['map'](function(_0xbd75e4){return refreshOauth2MicrosoftAccessToken(_0xbd75e4)[_0xb351('0x3b')](function(_0x45ea6c){startRefreshInterval(_0x45ea6c);});});return Promise[_0xb351('0x4a')](_0xa36155);})[_0xb351('0x4b')](function(_0x5d5bf){var _0x38ce36=_0x5d5bf?util[_0xb351('0x4c')](_0x5d5bf,{'showHidden':![],'depth':null}):'';logger[_0xb351('0x4d')](_0xb351('0x4e'),_0x38ce36);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 6f7c396..357ba26 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa467=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0xa467,0x143));var _0x7a46=function(_0x1a0e2f,_0x173d4f){_0x1a0e2f=_0x1a0e2f-0x0;var _0x1b74c6=_0xa467[_0x1a0e2f];return _0x1b74c6;};'use strict';var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var moment=require(_0x7a46('0x2'));var BPromise=require(_0x7a46('0x3'));var rs=require(_0x7a46('0x4'));var fs=require('fs');var Redis=require(_0x7a46('0x5'));var db=require(_0x7a46('0x6'))['db'];var utils=require(_0x7a46('0x7'));var logger=require(_0x7a46('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7a46('0x9'));var client=jayson[_0x7a46('0xa')][_0x7a46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x463cdf,_0x6d8fce,_0x550c38){return new BPromise(function(_0x341d9e,_0x1f8b07){return client[_0x7a46('0xc')](_0x463cdf,_0x550c38)[_0x7a46('0xd')](function(_0x382b56){logger[_0x7a46('0xe')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x7a46('0xf'));logger['debug'](_0x7a46('0x10'),_0x6d8fce,'request\x20sent',JSON[_0x7a46('0x11')](_0x382b56));if(_0x382b56[_0x7a46('0x12')]){if(_0x382b56[_0x7a46('0x12')][_0x7a46('0x13')]===0x1f4){logger[_0x7a46('0x12')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x382b56[_0x7a46('0x12')][_0x7a46('0x14')]);return _0x1f8b07(_0x382b56[_0x7a46('0x12')][_0x7a46('0x14')]);}logger[_0x7a46('0x12')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x382b56[_0x7a46('0x12')]['message']);return _0x341d9e(_0x382b56['error'][_0x7a46('0x14')]);}else{logger[_0x7a46('0xe')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x7a46('0xf'));_0x341d9e(_0x382b56['result'][_0x7a46('0x14')]);}})[_0x7a46('0x15')](function(_0x50e40e){logger[_0x7a46('0x12')]('CloudProvider,\x20%s,\x20%s',_0x6d8fce,_0x50e40e);_0x1f8b07(_0x50e40e);});});}
\ No newline at end of file
+var _0xe797=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe797,0x12a));var _0x7e79=function(_0x41ae18,_0x570d43){_0x41ae18=_0x41ae18-0x0;var _0x51c805=_0xe797[_0x41ae18];return _0x51c805;};'use strict';var _=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var moment=require(_0x7e79('0x2'));var BPromise=require(_0x7e79('0x3'));var rs=require(_0x7e79('0x4'));var fs=require('fs');var Redis=require(_0x7e79('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e79('0x6'));var logger=require(_0x7e79('0x7'))('rpc');var config=require(_0x7e79('0x8'));var jayson=require(_0x7e79('0x9'));var client=jayson[_0x7e79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdfa1,_0x9dd35a,_0x358bd6){return new BPromise(function(_0x484e66,_0x54aab5){return client[_0x7e79('0xb')](_0x4fdfa1,_0x358bd6)[_0x7e79('0xc')](function(_0x134e89){logger['info'](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));logger[_0x7e79('0xf')](_0x7e79('0x10'),_0x9dd35a,_0x7e79('0xe'),JSON[_0x7e79('0x11')](_0x134e89));if(_0x134e89[_0x7e79('0x12')]){if(_0x134e89[_0x7e79('0x12')][_0x7e79('0x13')]===0x1f4){logger['error'](_0x7e79('0xd'),_0x9dd35a,_0x134e89['error'][_0x7e79('0x14')]);return _0x54aab5(_0x134e89['error'][_0x7e79('0x14')]);}logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x134e89[_0x7e79('0x12')]['message']);return _0x484e66(_0x134e89[_0x7e79('0x12')][_0x7e79('0x14')]);}else{logger[_0x7e79('0x15')](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));_0x484e66(_0x134e89[_0x7e79('0x16')][_0x7e79('0x14')]);}})['catch'](function(_0x2ec0c7){logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x2ec0c7);_0x54aab5(_0x2ec0c7);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 84f9901..2199671 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x1261,0x144));var _0x1126=function(_0x4a6934,_0x1237f4){_0x4a6934=_0x4a6934-0x0;var _0x532acf=_0x1261[_0x4a6934];return _0x532acf;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x233821,_0x230bfc){var _0xf3613e=function(_0x3594d9){while(--_0x3594d9){_0x233821['push'](_0x233821['shift']());}};_0xf3613e(++_0x230bfc);}(_0xadb5,0xad));var _0x5adb=function(_0x367e32,_0x9a8868){_0x367e32=_0x367e32-0x0;var _0x3d7295=_0xadb5[_0x367e32];return _0x3d7295;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 92fa0f3..366f310 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 _0x6690=['STRING','name','exports'];(function(_0x94a268,_0x68f124){var _0x6eb3fd=function(_0x2bdce7){while(--_0x2bdce7){_0x94a268['push'](_0x94a268['shift']());}};_0x6eb3fd(++_0x68f124);}(_0x6690,0x7a));var _0x0669=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x6690[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require('sequelize');module[_0x0669('0x0')]={'name':{'type':Sequelize[_0x0669('0x1')],'unique':_0x0669('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0669('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0669('0x1')]},'phone':{'type':Sequelize[_0x0669('0x1')]},'fax':{'type':Sequelize[_0x0669('0x1')]},'type':{'type':Sequelize[_0x0669('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0669('0x1')]},'email':{'type':Sequelize[_0x0669('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0669('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x0669('0x1')]},'sCity':{'type':Sequelize[_0x0669('0x1')]},'sCountry':{'type':Sequelize[_0x0669('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd9ca=['exports','STRING','sequelize'];(function(_0x419f08,_0x140060){var _0x47b5f8=function(_0x1906fa){while(--_0x1906fa){_0x419f08['push'](_0x419f08['shift']());}};_0x47b5f8(++_0x140060);}(_0xd9ca,0x1a0));var _0xad9c=function(_0x449b95,_0x3f0845){_0x449b95=_0x449b95-0x0;var _0x4e6519=_0xd9ca[_0x449b95];return _0x4e6519;};'use strict';var Sequelize=require(_0xad9c('0x0'));module[_0xad9c('0x1')]={'name':{'type':Sequelize[_0xad9c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xad9c('0x2')]},'companyId':{'type':Sequelize[_0xad9c('0x2')]},'website':{'type':Sequelize[_0xad9c('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xad9c('0x2')]},'type':{'type':Sequelize[_0xad9c('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xad9c('0x2')]},'city':{'type':Sequelize[_0xad9c('0x2')]},'country':{'type':Sequelize[_0xad9c('0x2')]},'email':{'type':Sequelize[_0xad9c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xad9c('0x2')]},'sCity':{'type':Sequelize[_0xad9c('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xad9c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index f4bf583..3ecd6b3 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 _0xc2bc=['stack','name','send','index','describe','model','keys','intersection','attributes','query','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','error'];(function(_0x5288a8,_0x3dafed){var _0x1f9e67=function(_0x26e598){while(--_0x26e598){_0x5288a8['push'](_0x5288a8['shift']());}};_0x1f9e67(++_0x3dafed);}(_0xc2bc,0x139));var _0xcc2b=function(_0x36b927,_0x67c31f){_0x36b927=_0x36b927-0x0;var _0x42e629=_0xc2bc[_0x36b927];return _0x42e629;};'use strict';var emlformat=require(_0xcc2b('0x0'));var rimraf=require(_0xcc2b('0x1'));var zipdir=require(_0xcc2b('0x2'));var jsonpatch=require(_0xcc2b('0x3'));var rp=require(_0xcc2b('0x4'));var moment=require(_0xcc2b('0x5'));var BPromise=require(_0xcc2b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc2b('0x7'));var sox=require('sox');var csv=require(_0xcc2b('0x8'));var ejs=require(_0xcc2b('0x9'));var fs=require('fs');var fs_extra=require(_0xcc2b('0xa'));var _=require(_0xcc2b('0xb'));var squel=require('squel');var crypto=require(_0xcc2b('0xc'));var jsforce=require(_0xcc2b('0xd'));var deskjs=require(_0xcc2b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc2b('0xf'));var authService=require(_0xcc2b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc2b('0x11'));var logger=require(_0xcc2b('0x12'))(_0xcc2b('0x13'));var utils=require(_0xcc2b('0x14'));var config=require(_0xcc2b('0x15'));var licenseUtil=require(_0xcc2b('0x16'));var db=require(_0xcc2b('0x17'))['db'];function respondWithStatusCode(_0x1de27c,_0x17e196){_0x17e196=_0x17e196||0xcc;return function(_0x124553){if(_0x124553){return _0x1de27c[_0xcc2b('0x18')](_0x17e196);}return _0x1de27c['status'](_0x17e196)[_0xcc2b('0x19')]();};}function respondWithResult(_0x56ba6a,_0x5cf089){_0x5cf089=_0x5cf089||0xc8;return function(_0xfaddb8){if(_0xfaddb8){return _0x56ba6a[_0xcc2b('0x1a')](_0x5cf089)[_0xcc2b('0x1b')](_0xfaddb8);}};}function respondWithFilteredResult(_0x55ea90,_0x4d8eeb){return function(_0x593fd5){if(_0x593fd5){var _0x347f66=typeof _0x4d8eeb[_0xcc2b('0x1c')]==='undefined'&&typeof _0x4d8eeb[_0xcc2b('0x1d')]==='undefined';var _0xd68cfe=_0x593fd5['count'];var _0x12f71d=_0x347f66?0x0:_0x4d8eeb[_0xcc2b('0x1c')];var _0x1356d2=_0x347f66?_0x593fd5[_0xcc2b('0x1e')]:_0x4d8eeb[_0xcc2b('0x1c')]+_0x4d8eeb[_0xcc2b('0x1d')];var _0x22ad92;if(_0x1356d2>=_0xd68cfe){_0x1356d2=_0xd68cfe;_0x22ad92=0xc8;}else{_0x22ad92=0xce;}_0x55ea90[_0xcc2b('0x1a')](_0x22ad92);return _0x55ea90[_0xcc2b('0x1f')](_0xcc2b('0x20'),_0x12f71d+'-'+_0x1356d2+'/'+_0xd68cfe)[_0xcc2b('0x1b')](_0x593fd5);}return null;};}function patchUpdates(_0x3df0fc){return function(_0x5f3dcd){try{jsonpatch[_0xcc2b('0x21')](_0x5f3dcd,_0x3df0fc,!![]);}catch(_0x52c601){return BPromise[_0xcc2b('0x22')](_0x52c601);}return _0x5f3dcd[_0xcc2b('0x23')]();};}function saveUpdates(_0x4d0a5c,_0x4a037e){return function(_0x35b60d){if(_0x35b60d){return _0x35b60d[_0xcc2b('0x24')](_0x4d0a5c)['then'](function(_0xb9ae5c){return _0xb9ae5c;});}return null;};}function removeEntity(_0xd0d805,_0x50f385){return function(_0x3b30e7){if(_0x3b30e7){return _0x3b30e7['destroy']()[_0xcc2b('0x25')](function(){var _0x5a49e7=_0x3b30e7[_0xcc2b('0x26')]({'plain':!![]});var _0x49850=_0xcc2b('0x27');return db[_0xcc2b('0x28')][_0xcc2b('0x29')]({'where':{'type':_0x49850,'resourceId':_0x5a49e7['id']}})[_0xcc2b('0x25')](function(){return _0x3b30e7;});})['then'](function(){_0xd0d805['status'](0xcc)[_0xcc2b('0x19')]();});}};}function handleEntityNotFound(_0x5f8161,_0x76af9d){return function(_0x132efb){if(!_0x132efb){_0x5f8161[_0xcc2b('0x18')](0x194);}return _0x132efb;};}function handleError(_0x4d5858,_0x51a8c7){_0x51a8c7=_0x51a8c7||0x1f4;return function(_0x34e436){logger[_0xcc2b('0x2a')](_0x34e436[_0xcc2b('0x2b')]);if(_0x34e436['name']){delete _0x34e436[_0xcc2b('0x2c')];}_0x4d5858['status'](_0x51a8c7)[_0xcc2b('0x2d')](_0x34e436);};}exports[_0xcc2b('0x2e')]=function(_0x2b14d9,_0x41381a){var _0x25962e={},_0x5dec43={},_0x128f5a={'count':0x0,'rows':[]};return db['CmCompany'][_0xcc2b('0x2f')]()[_0xcc2b('0x25')](function(_0x198a80){_0x5dec43[_0xcc2b('0x30')]=_[_0xcc2b('0x31')](_0x198a80);_0x5dec43['query']=_[_0xcc2b('0x31')](_0x2b14d9['query']);_0x5dec43['filters']=_[_0xcc2b('0x32')](_0x5dec43['model'],_0x5dec43['query']);_0x25962e[_0xcc2b('0x33')]=_[_0xcc2b('0x32')](_0x5dec43[_0xcc2b('0x30')],qs['fields'](_0x2b14d9[_0xcc2b('0x34')][_0xcc2b('0x35')]));_0x25962e[_0xcc2b('0x33')]=_0x25962e[_0xcc2b('0x33')][_0xcc2b('0x36')]?_0x25962e[_0xcc2b('0x33')]:_0x5dec43[_0xcc2b('0x30')];if(!_0x2b14d9[_0xcc2b('0x34')][_0xcc2b('0x37')]('nolimit')){_0x25962e['limit']=qs[_0xcc2b('0x1d')](_0x2b14d9[_0xcc2b('0x34')]['limit']);_0x25962e[_0xcc2b('0x1c')]=qs[_0xcc2b('0x1c')](_0x2b14d9['query'][_0xcc2b('0x1c')]);}_0x25962e[_0xcc2b('0x38')]=qs[_0xcc2b('0x39')](_0x2b14d9[_0xcc2b('0x34')][_0xcc2b('0x39')]);_0x25962e['where']=qs[_0xcc2b('0x3a')](_['pick'](_0x2b14d9[_0xcc2b('0x34')],_0x5dec43[_0xcc2b('0x3a')]),_0x198a80);if(_0x2b14d9['query'][_0xcc2b('0x3b')]){_0x25962e[_0xcc2b('0x3c')]=_['merge'](_0x25962e['where'],{'$or':_['map'](_0x25962e[_0xcc2b('0x33')],function(_0x16d0d8){var _0x16222a={};_0x16222a[_0x16d0d8]={'$like':'%'+_0x2b14d9['query'][_0xcc2b('0x3b')]+'%'};return _0x16222a;})});}_0x25962e=_[_0xcc2b('0x3d')]({},_0x25962e,_0x2b14d9[_0xcc2b('0x3e')]);var _0x471a5e={'where':_0x25962e['where']};return db[_0xcc2b('0x3f')][_0xcc2b('0x1e')](_0x471a5e)[_0xcc2b('0x25')](function(_0xf9647f){_0x128f5a[_0xcc2b('0x1e')]=_0xf9647f;if(_0x2b14d9['query'][_0xcc2b('0x40')]){_0x25962e['include']=[{'all':!![]}];}return db['CmCompany'][_0xcc2b('0x41')](_0x25962e);})[_0xcc2b('0x25')](function(_0x1c8bc7){_0x128f5a[_0xcc2b('0x42')]=_0x1c8bc7;return _0x128f5a;})[_0xcc2b('0x25')](respondWithFilteredResult(_0x41381a,_0x25962e))[_0xcc2b('0x43')](handleError(_0x41381a,null));})[_0xcc2b('0x43')](handleError(_0x41381a,null));};exports[_0xcc2b('0x44')]=function(_0x452fb,_0x1cdbc6){var _0xfc15a2={'raw':![],'where':{'id':_0x452fb[_0xcc2b('0x45')]['id']}},_0x1bc373={};_0x1bc373[_0xcc2b('0x30')]=_[_0xcc2b('0x31')](db[_0xcc2b('0x3f')][_0xcc2b('0x46')]);_0x1bc373['query']=_[_0xcc2b('0x31')](_0x452fb['query']);_0x1bc373[_0xcc2b('0x3a')]=_['intersection'](_0x1bc373[_0xcc2b('0x30')],_0x1bc373['query']);_0xfc15a2['attributes']=_[_0xcc2b('0x32')](_0x1bc373[_0xcc2b('0x30')],qs[_0xcc2b('0x35')](_0x452fb['query']['fields']));_0xfc15a2[_0xcc2b('0x33')]=_0xfc15a2[_0xcc2b('0x33')][_0xcc2b('0x36')]?_0xfc15a2[_0xcc2b('0x33')]:_0x1bc373['model'];if(_0x452fb[_0xcc2b('0x34')][_0xcc2b('0x40')]){_0xfc15a2[_0xcc2b('0x47')]=[{'all':!![]}];}_0xfc15a2=_[_0xcc2b('0x3d')]({},_0xfc15a2,_0x452fb[_0xcc2b('0x3e')]);return db['CmCompany'][_0xcc2b('0x48')](_0xfc15a2)['then'](handleEntityNotFound(_0x1cdbc6,null))[_0xcc2b('0x25')](respondWithResult(_0x1cdbc6,null))[_0xcc2b('0x43')](handleError(_0x1cdbc6,null));};exports[_0xcc2b('0x49')]=function(_0x39b934,_0x53f480){return db[_0xcc2b('0x3f')][_0xcc2b('0x49')](_0x39b934[_0xcc2b('0x4a')],{})[_0xcc2b('0x25')](function(_0x38cac6){var _0x46d5ce=_0x39b934[_0xcc2b('0x4b')]['get']({'plain':!![]});if(!_0x46d5ce)throw new Error(_0xcc2b('0x4c'));if(_0x46d5ce['role']===_0xcc2b('0x4b')){var _0x2dd09a=_0x38cac6[_0xcc2b('0x26')]({'plain':!![]});var _0x4e4193=_0xcc2b('0x27');return db[_0xcc2b('0x4d')]['find']({'where':{'name':_0x4e4193,'userProfileId':_0x46d5ce[_0xcc2b('0x4e')]},'raw':!![]})[_0xcc2b('0x25')](function(_0x440d32){if(_0x440d32&&_0x440d32[_0xcc2b('0x4f')]===0x0){return db['UserProfileResource'][_0xcc2b('0x49')]({'name':_0x2dd09a[_0xcc2b('0x2c')],'resourceId':_0x2dd09a['id'],'type':_0x440d32[_0xcc2b('0x2c')],'sectionId':_0x440d32['id']},{})[_0xcc2b('0x25')](function(){return _0x38cac6;});}else{return _0x38cac6;}})[_0xcc2b('0x43')](function(_0x1fbfd7){logger[_0xcc2b('0x2a')](_0xcc2b('0x50'),_0x1fbfd7);throw _0x1fbfd7;});}return _0x38cac6;})[_0xcc2b('0x25')](respondWithResult(_0x53f480,0xc9))['catch'](handleError(_0x53f480,null));};exports[_0xcc2b('0x24')]=function(_0x35ef03,_0x1bb6ef){if(_0x35ef03[_0xcc2b('0x4a')]['id']){delete _0x35ef03[_0xcc2b('0x4a')]['id'];}return db[_0xcc2b('0x3f')]['find']({'where':{'id':_0x35ef03['params']['id']}})[_0xcc2b('0x25')](handleEntityNotFound(_0x1bb6ef,null))[_0xcc2b('0x25')](saveUpdates(_0x35ef03[_0xcc2b('0x4a')],null))[_0xcc2b('0x25')](respondWithResult(_0x1bb6ef,null))[_0xcc2b('0x43')](handleError(_0x1bb6ef,null));};exports['destroy']=function(_0x155ff3,_0x5463e2){return db['CmCompany'][_0xcc2b('0x48')]({'where':{'id':_0x155ff3[_0xcc2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x5463e2,null))['then'](removeEntity(_0x5463e2,null))[_0xcc2b('0x43')](handleError(_0x5463e2,null));};exports[_0xcc2b('0x2f')]=function(_0x3565bc,_0xaa1892){return db[_0xcc2b('0x3f')][_0xcc2b('0x2f')]()[_0xcc2b('0x25')](respondWithResult(_0xaa1892,null))[_0xcc2b('0x43')](handleError(_0xaa1892,null));};exports[_0xcc2b('0x51')]=function(_0x54e4d0,_0x401f97,_0x55eae0){return db[_0xcc2b('0x52')][_0xcc2b('0x48')]({'where':{'id':_0x54e4d0[_0xcc2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x401f97,null))[_0xcc2b('0x25')](function(_0x2b502b){if(_0x2b502b){return _0x2b502b[_0xcc2b('0x51')](_0x54e4d0[_0xcc2b('0x4a')][_0xcc2b('0x53')],_[_0xcc2b('0x54')](_0x54e4d0['body'],[_0xcc2b('0x53'),'id'])||{});}})['then'](respondWithResult(_0x401f97,null))[_0xcc2b('0x43')](handleError(_0x401f97,null));};exports[_0xcc2b('0x55')]=function(_0xb1ecc5,_0x3faa84,_0x3bce32){var _0x42c5d5={};var _0x3d236c={};var _0x5e5a1f;var _0x314345;return db[_0xcc2b('0x3f')][_0xcc2b('0x56')]({'where':{'id':_0xb1ecc5[_0xcc2b('0x45')]['id']}})[_0xcc2b('0x25')](handleEntityNotFound(_0x3faa84,null))[_0xcc2b('0x25')](function(_0x3a71dc){if(_0x3a71dc){_0x5e5a1f=_0x3a71dc;_0x3d236c['model']=_[_0xcc2b('0x31')](db[_0xcc2b('0x52')][_0xcc2b('0x46')]);_0x3d236c[_0xcc2b('0x34')]=_[_0xcc2b('0x31')](_0xb1ecc5[_0xcc2b('0x34')]);_0x3d236c[_0xcc2b('0x3a')]=_['intersection'](_0x3d236c[_0xcc2b('0x30')],_0x3d236c[_0xcc2b('0x34')]);_0x42c5d5[_0xcc2b('0x33')]=_[_0xcc2b('0x32')](_0x3d236c['model'],qs[_0xcc2b('0x35')](_0xb1ecc5[_0xcc2b('0x34')][_0xcc2b('0x35')]));_0x42c5d5[_0xcc2b('0x33')]=_0x42c5d5[_0xcc2b('0x33')][_0xcc2b('0x36')]?_0x42c5d5['attributes']:_0x3d236c[_0xcc2b('0x30')];_0x42c5d5[_0xcc2b('0x38')]=qs[_0xcc2b('0x39')](_0xb1ecc5['query'][_0xcc2b('0x39')]);_0x42c5d5['where']=qs[_0xcc2b('0x3a')](_['pick'](_0xb1ecc5[_0xcc2b('0x34')],_0x3d236c['filters']));if(_0xb1ecc5[_0xcc2b('0x34')][_0xcc2b('0x3b')]){_0x42c5d5['where']=_[_0xcc2b('0x3d')](_0x42c5d5[_0xcc2b('0x3c')],{'$or':_[_0xcc2b('0x57')](_0x42c5d5[_0xcc2b('0x33')],function(_0x366df1){var _0x106489={};_0x106489[_0x366df1]={'$like':'%'+_0xb1ecc5[_0xcc2b('0x34')]['filter']+'%'};return _0x106489;})});}_0x42c5d5=_[_0xcc2b('0x3d')]({},_0x42c5d5,_0xb1ecc5[_0xcc2b('0x3e')]);return _0x5e5a1f[_0xcc2b('0x55')](_0x42c5d5);}})['then'](function(_0x2d6ac3){if(_0x2d6ac3){_0x314345=_0x2d6ac3[_0xcc2b('0x36')];if(!_0xb1ecc5[_0xcc2b('0x34')][_0xcc2b('0x37')](_0xcc2b('0x58'))){_0x42c5d5[_0xcc2b('0x1d')]=qs['limit'](_0xb1ecc5[_0xcc2b('0x34')][_0xcc2b('0x1d')]);_0x42c5d5[_0xcc2b('0x1c')]=qs[_0xcc2b('0x1c')](_0xb1ecc5['query'][_0xcc2b('0x1c')]);}return _0x5e5a1f[_0xcc2b('0x55')](_0x42c5d5);}})['then'](function(_0x21b0b8){if(_0x21b0b8){return _0x21b0b8?{'count':_0x314345,'rows':_0x21b0b8}:null;}})[_0xcc2b('0x25')](respondWithResult(_0x3faa84,null))[_0xcc2b('0x43')](handleError(_0x3faa84,null));};
\ No newline at end of file
+var _0x26a0=['merge','map','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','get','Companies','UserProfileResource','then','end','error','stack','name','send','index','CmCompany','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0x26a0,0xc3));var _0x026a=function(_0x28dcd3,_0x33e8d0){_0x28dcd3=_0x28dcd3-0x0;var _0x44e5db=_0x26a0[_0x28dcd3];return _0x44e5db;};'use strict';var emlformat=require(_0x026a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x026a('0x1'));var rp=require(_0x026a('0x2'));var moment=require('moment');var BPromise=require(_0x026a('0x3'));var Mustache=require(_0x026a('0x4'));var util=require(_0x026a('0x5'));var path=require(_0x026a('0x6'));var sox=require(_0x026a('0x7'));var csv=require(_0x026a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x026a('0x9'));var _=require('lodash');var squel=require(_0x026a('0xa'));var crypto=require(_0x026a('0xb'));var jsforce=require(_0x026a('0xc'));var deskjs=require(_0x026a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x026a('0xe'));var authService=require(_0x026a('0xf'));var qs=require(_0x026a('0x10'));var as=require(_0x026a('0x11'));var hardwareService=require(_0x026a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x026a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x026a('0x14'))['db'];function respondWithStatusCode(_0x513565,_0x31b8fc){_0x31b8fc=_0x31b8fc||0xcc;return function(_0x4b8475){if(_0x4b8475){return _0x513565[_0x026a('0x15')](_0x31b8fc);}return _0x513565[_0x026a('0x16')](_0x31b8fc)['end']();};}function respondWithResult(_0x1eb5b6,_0x1e0a3e){_0x1e0a3e=_0x1e0a3e||0xc8;return function(_0x1a43e6){if(_0x1a43e6){return _0x1eb5b6[_0x026a('0x16')](_0x1e0a3e)[_0x026a('0x17')](_0x1a43e6);}};}function respondWithFilteredResult(_0x1497e5,_0x44c66f){return function(_0xb66623){if(_0xb66623){var _0x43fed2=typeof _0x44c66f['offset']===_0x026a('0x18')&&typeof _0x44c66f[_0x026a('0x19')]===_0x026a('0x18');var _0x331603=_0xb66623['count'];var _0x1d5ebf=_0x43fed2?0x0:_0x44c66f[_0x026a('0x1a')];var _0xbcb4ff=_0x43fed2?_0xb66623[_0x026a('0x1b')]:_0x44c66f[_0x026a('0x1a')]+_0x44c66f['limit'];var _0x11be86;if(_0xbcb4ff>=_0x331603){_0xbcb4ff=_0x331603;_0x11be86=0xc8;}else{_0x11be86=0xce;}_0x1497e5[_0x026a('0x16')](_0x11be86);return _0x1497e5['set'](_0x026a('0x1c'),_0x1d5ebf+'-'+_0xbcb4ff+'/'+_0x331603)[_0x026a('0x17')](_0xb66623);}return null;};}function patchUpdates(_0x2a4449){return function(_0x2cfdb8){try{jsonpatch[_0x026a('0x1d')](_0x2cfdb8,_0x2a4449,!![]);}catch(_0x277feb){return BPromise[_0x026a('0x1e')](_0x277feb);}return _0x2cfdb8[_0x026a('0x1f')]();};}function saveUpdates(_0x1f39cc,_0x3aa886){return function(_0x5560bb){if(_0x5560bb){return _0x5560bb[_0x026a('0x20')](_0x1f39cc)['then'](function(_0x58de78){return _0x58de78;});}return null;};}function removeEntity(_0x29bf50,_0x12c6be){return function(_0x50e113){if(_0x50e113){return _0x50e113[_0x026a('0x21')]()['then'](function(){var _0x532a32=_0x50e113[_0x026a('0x22')]({'plain':!![]});var _0x215956=_0x026a('0x23');return db[_0x026a('0x24')]['destroy']({'where':{'type':_0x215956,'resourceId':_0x532a32['id']}})[_0x026a('0x25')](function(){return _0x50e113;});})[_0x026a('0x25')](function(){_0x29bf50[_0x026a('0x16')](0xcc)[_0x026a('0x26')]();});}};}function handleEntityNotFound(_0x2c9c0f,_0x1dbbec){return function(_0x9ac4e6){if(!_0x9ac4e6){_0x2c9c0f[_0x026a('0x15')](0x194);}return _0x9ac4e6;};}function handleError(_0x287a31,_0x4eb141){_0x4eb141=_0x4eb141||0x1f4;return function(_0x1f96e8){logger[_0x026a('0x27')](_0x1f96e8[_0x026a('0x28')]);if(_0x1f96e8[_0x026a('0x29')]){delete _0x1f96e8[_0x026a('0x29')];}_0x287a31[_0x026a('0x16')](_0x4eb141)[_0x026a('0x2a')](_0x1f96e8);};}exports[_0x026a('0x2b')]=function(_0x4f7d29,_0x5e6ec4){var _0x468576={},_0x39bad2={},_0x1e4f06={'count':0x0,'rows':[]};return db[_0x026a('0x2c')]['describe']()[_0x026a('0x25')](function(_0x3a6530){_0x39bad2[_0x026a('0x2d')]=_['keys'](_0x3a6530);_0x39bad2[_0x026a('0x2e')]=_['keys'](_0x4f7d29[_0x026a('0x2e')]);_0x39bad2[_0x026a('0x2f')]=_[_0x026a('0x30')](_0x39bad2[_0x026a('0x2d')],_0x39bad2[_0x026a('0x2e')]);_0x468576['attributes']=_['intersection'](_0x39bad2[_0x026a('0x2d')],qs[_0x026a('0x31')](_0x4f7d29['query'][_0x026a('0x31')]));_0x468576[_0x026a('0x32')]=_0x468576[_0x026a('0x32')][_0x026a('0x33')]?_0x468576[_0x026a('0x32')]:_0x39bad2[_0x026a('0x2d')];if(!_0x4f7d29[_0x026a('0x2e')][_0x026a('0x34')]('nolimit')){_0x468576['limit']=qs[_0x026a('0x19')](_0x4f7d29[_0x026a('0x2e')]['limit']);_0x468576[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x4f7d29[_0x026a('0x2e')][_0x026a('0x1a')]);}_0x468576[_0x026a('0x35')]=qs[_0x026a('0x36')](_0x4f7d29[_0x026a('0x2e')]['sort']);_0x468576[_0x026a('0x37')]=qs[_0x026a('0x2f')](_['pick'](_0x4f7d29['query'],_0x39bad2['filters']),_0x3a6530);if(_0x4f7d29[_0x026a('0x2e')][_0x026a('0x38')]){_0x468576['where']=_[_0x026a('0x39')](_0x468576[_0x026a('0x37')],{'$or':_[_0x026a('0x3a')](_0x468576[_0x026a('0x32')],function(_0x2be8fb){var _0xea8032={};_0xea8032[_0x2be8fb]={'$like':'%'+_0x4f7d29[_0x026a('0x2e')][_0x026a('0x38')]+'%'};return _0xea8032;})});}_0x468576=_['merge']({},_0x468576,_0x4f7d29[_0x026a('0x3b')]);var _0x4352f5={'where':_0x468576[_0x026a('0x37')]};return db['CmCompany'][_0x026a('0x1b')](_0x4352f5)['then'](function(_0x307a55){_0x1e4f06[_0x026a('0x1b')]=_0x307a55;if(_0x4f7d29[_0x026a('0x2e')]['includeAll']){_0x468576[_0x026a('0x3c')]=[{'all':!![]}];}return db[_0x026a('0x2c')]['findAll'](_0x468576);})[_0x026a('0x25')](function(_0x4e1fdd){_0x1e4f06[_0x026a('0x3d')]=_0x4e1fdd;return _0x1e4f06;})['then'](respondWithFilteredResult(_0x5e6ec4,_0x468576))[_0x026a('0x3e')](handleError(_0x5e6ec4,null));})[_0x026a('0x3e')](handleError(_0x5e6ec4,null));};exports[_0x026a('0x3f')]=function(_0x4e434c,_0x75f796){var _0x35ebbd={'raw':![],'where':{'id':_0x4e434c[_0x026a('0x40')]['id']}},_0x2d5206={};_0x2d5206[_0x026a('0x2d')]=_[_0x026a('0x41')](db[_0x026a('0x2c')][_0x026a('0x42')]);_0x2d5206[_0x026a('0x2e')]=_[_0x026a('0x41')](_0x4e434c[_0x026a('0x2e')]);_0x2d5206[_0x026a('0x2f')]=_['intersection'](_0x2d5206['model'],_0x2d5206['query']);_0x35ebbd[_0x026a('0x32')]=_[_0x026a('0x30')](_0x2d5206[_0x026a('0x2d')],qs[_0x026a('0x31')](_0x4e434c[_0x026a('0x2e')]['fields']));_0x35ebbd[_0x026a('0x32')]=_0x35ebbd[_0x026a('0x32')][_0x026a('0x33')]?_0x35ebbd['attributes']:_0x2d5206['model'];if(_0x4e434c[_0x026a('0x2e')][_0x026a('0x43')]){_0x35ebbd[_0x026a('0x3c')]=[{'all':!![]}];}_0x35ebbd=_['merge']({},_0x35ebbd,_0x4e434c['options']);return db[_0x026a('0x2c')][_0x026a('0x44')](_0x35ebbd)[_0x026a('0x25')](handleEntityNotFound(_0x75f796,null))['then'](respondWithResult(_0x75f796,null))['catch'](handleError(_0x75f796,null));};exports[_0x026a('0x45')]=function(_0x1b8948,_0x196b6e){return db[_0x026a('0x2c')][_0x026a('0x45')](_0x1b8948[_0x026a('0x46')],{})['then'](function(_0x3202e4){var _0x5b0e77=_0x1b8948[_0x026a('0x47')]['get']({'plain':!![]});if(!_0x5b0e77)throw new Error(_0x026a('0x48'));if(_0x5b0e77['role']===_0x026a('0x47')){var _0x39f54b=_0x3202e4[_0x026a('0x22')]({'plain':!![]});var _0x2960d6=_0x026a('0x23');return db[_0x026a('0x49')][_0x026a('0x44')]({'where':{'name':_0x2960d6,'userProfileId':_0x5b0e77['userProfileId']},'raw':!![]})[_0x026a('0x25')](function(_0x61bef4){if(_0x61bef4&&_0x61bef4[_0x026a('0x4a')]===0x0){return db['UserProfileResource'][_0x026a('0x45')]({'name':_0x39f54b[_0x026a('0x29')],'resourceId':_0x39f54b['id'],'type':_0x61bef4['name'],'sectionId':_0x61bef4['id']},{})[_0x026a('0x25')](function(){return _0x3202e4;});}else{return _0x3202e4;}})['catch'](function(_0x51f5ea){logger[_0x026a('0x27')](_0x026a('0x4b'),_0x51f5ea);throw _0x51f5ea;});}return _0x3202e4;})['then'](respondWithResult(_0x196b6e,0xc9))[_0x026a('0x3e')](handleError(_0x196b6e,null));};exports[_0x026a('0x20')]=function(_0x1ddc7a,_0x54b4be){if(_0x1ddc7a['body']['id']){delete _0x1ddc7a[_0x026a('0x46')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x1ddc7a['params']['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x54b4be,null))[_0x026a('0x25')](saveUpdates(_0x1ddc7a[_0x026a('0x46')],null))[_0x026a('0x25')](respondWithResult(_0x54b4be,null))[_0x026a('0x3e')](handleError(_0x54b4be,null));};exports['destroy']=function(_0x7d9d1d,_0x248bdd){return db[_0x026a('0x2c')][_0x026a('0x44')]({'where':{'id':_0x7d9d1d[_0x026a('0x40')]['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x248bdd,null))[_0x026a('0x25')](removeEntity(_0x248bdd,null))[_0x026a('0x3e')](handleError(_0x248bdd,null));};exports[_0x026a('0x4c')]=function(_0x5ba3d8,_0x179adc){return db[_0x026a('0x2c')]['describe']()[_0x026a('0x25')](respondWithResult(_0x179adc,null))['catch'](handleError(_0x179adc,null));};exports[_0x026a('0x4d')]=function(_0x1e0b91,_0xd69b52,_0x183e5d){return db[_0x026a('0x4e')][_0x026a('0x44')]({'where':{'id':_0x1e0b91['params']['id']}})['then'](handleEntityNotFound(_0xd69b52,null))['then'](function(_0x2951bb){if(_0x2951bb){return _0x2951bb[_0x026a('0x4d')](_0x1e0b91[_0x026a('0x46')][_0x026a('0x4f')],_[_0x026a('0x50')](_0x1e0b91['body'],[_0x026a('0x4f'),'id'])||{});}})[_0x026a('0x25')](respondWithResult(_0xd69b52,null))['catch'](handleError(_0xd69b52,null));};exports[_0x026a('0x51')]=function(_0x457ffa,_0x4c9db1,_0x1bf439){var _0x5d4eda={};var _0x333d00={};var _0x3955ee;var _0x1150c4;return db[_0x026a('0x2c')][_0x026a('0x52')]({'where':{'id':_0x457ffa['params']['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x4c9db1,null))['then'](function(_0x40bc2c){if(_0x40bc2c){_0x3955ee=_0x40bc2c;_0x333d00[_0x026a('0x2d')]=_[_0x026a('0x41')](db['CmContact'][_0x026a('0x42')]);_0x333d00[_0x026a('0x2e')]=_['keys'](_0x457ffa['query']);_0x333d00[_0x026a('0x2f')]=_[_0x026a('0x30')](_0x333d00['model'],_0x333d00[_0x026a('0x2e')]);_0x5d4eda[_0x026a('0x32')]=_['intersection'](_0x333d00['model'],qs[_0x026a('0x31')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x31')]));_0x5d4eda[_0x026a('0x32')]=_0x5d4eda[_0x026a('0x32')][_0x026a('0x33')]?_0x5d4eda[_0x026a('0x32')]:_0x333d00[_0x026a('0x2d')];_0x5d4eda['order']=qs[_0x026a('0x36')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x36')]);_0x5d4eda['where']=qs[_0x026a('0x2f')](_[_0x026a('0x53')](_0x457ffa[_0x026a('0x2e')],_0x333d00[_0x026a('0x2f')]));if(_0x457ffa[_0x026a('0x2e')][_0x026a('0x38')]){_0x5d4eda[_0x026a('0x37')]=_['merge'](_0x5d4eda['where'],{'$or':_[_0x026a('0x3a')](_0x5d4eda['attributes'],function(_0x138589){var _0x2fb5ea={};_0x2fb5ea[_0x138589]={'$like':'%'+_0x457ffa[_0x026a('0x2e')][_0x026a('0x38')]+'%'};return _0x2fb5ea;})});}_0x5d4eda=_[_0x026a('0x39')]({},_0x5d4eda,_0x457ffa[_0x026a('0x3b')]);return _0x3955ee[_0x026a('0x51')](_0x5d4eda);}})['then'](function(_0xfa49b4){if(_0xfa49b4){_0x1150c4=_0xfa49b4[_0x026a('0x33')];if(!_0x457ffa[_0x026a('0x2e')][_0x026a('0x34')]('nolimit')){_0x5d4eda[_0x026a('0x19')]=qs[_0x026a('0x19')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x19')]);_0x5d4eda[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x1a')]);}return _0x3955ee[_0x026a('0x51')](_0x5d4eda);}})[_0x026a('0x25')](function(_0x4d2704){if(_0x4d2704){return _0x4d2704?{'count':_0x1150c4,'rows':_0x4d2704}:null;}})[_0x026a('0x25')](respondWithResult(_0x4c9db1,null))[_0x026a('0x3e')](handleError(_0x4c9db1,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 852e4b6..a82e72a 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 _0x6d1c=['exports','define','CmCompany','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x6d1c,0xd3));var _0xc6d1=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x6d1c[_0x4b7895];return _0x264180;};'use strict';var _=require('lodash');var util=require(_0xc6d1('0x0'));var logger=require(_0xc6d1('0x1'))(_0xc6d1('0x2'));var moment=require(_0xc6d1('0x3'));var BPromise=require(_0xc6d1('0x4'));var rp=require(_0xc6d1('0x5'));var fs=require('fs');var path=require(_0xc6d1('0x6'));var rimraf=require(_0xc6d1('0x7'));var config=require(_0xc6d1('0x8'));var attributes=require(_0xc6d1('0x9'));module[_0xc6d1('0xa')]=function(_0x3743ce,_0x1e0578){return _0x3743ce[_0xc6d1('0xb')](_0xc6d1('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x496f=['request-promise','path','rimraf','./cmCompany.attributes','exports','cm_companies','lodash','util','moment','bluebird'];(function(_0x41a234,_0x572403){var _0x1219db=function(_0x30facf){while(--_0x30facf){_0x41a234['push'](_0x41a234['shift']());}};_0x1219db(++_0x572403);}(_0x496f,0x1c8));var _0xf496=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x496f[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xf496('0x0'));var util=require(_0xf496('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf496('0x2'));var BPromise=require(_0xf496('0x3'));var rp=require(_0xf496('0x4'));var fs=require('fs');var path=require(_0xf496('0x5'));var rimraf=require(_0xf496('0x6'));var config=require('../../config/environment');var attributes=require(_0xf496('0x7'));module[_0xf496('0x8')]=function(_0x4503d3,_0x3f98b5){return _0x4503d3['define']('CmCompany',attributes,{'tableName':_0xf496('0x9'),'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 8a802ab..cfa85d3 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 _0x9088=['http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','bluebird','../../mysqldb','rpc','jayson/promise'];(function(_0x198099,_0x2b8ab1){var _0x111ae7=function(_0x49611f){while(--_0x49611f){_0x198099['push'](_0x198099['shift']());}};_0x111ae7(++_0x2b8ab1);}(_0x9088,0xdd));var _0x8908=function(_0x5d737d,_0x421884){_0x5d737d=_0x5d737d-0x0;var _0x29c646=_0x9088[_0x5d737d];return _0x29c646;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8908('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8908('0x1'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8908('0x2'));var config=require('../../config/environment');var jayson=require(_0x8908('0x3'));var client=jayson['client'][_0x8908('0x4')]({'port':0x232a});function respondWithRpcPromise(_0xf22cbc,_0x59ea19,_0x5abaf6){return new BPromise(function(_0x557384,_0x4f0197){return client['request'](_0xf22cbc,_0x5abaf6)[_0x8908('0x5')](function(_0xdaaf64){logger[_0x8908('0x6')](_0x8908('0x7'),_0x59ea19,_0x8908('0x8'));logger[_0x8908('0x9')](_0x8908('0xa'),_0x59ea19,_0x8908('0x8'),JSON['stringify'](_0xdaaf64));if(_0xdaaf64[_0x8908('0xb')]){if(_0xdaaf64[_0x8908('0xb')][_0x8908('0xc')]===0x1f4){logger[_0x8908('0xb')]('CmCompany,\x20%s,\x20%s',_0x59ea19,_0xdaaf64[_0x8908('0xb')][_0x8908('0xd')]);return _0x4f0197(_0xdaaf64[_0x8908('0xb')][_0x8908('0xd')]);}logger['error'](_0x8908('0x7'),_0x59ea19,_0xdaaf64[_0x8908('0xb')]['message']);return _0x557384(_0xdaaf64['error']['message']);}else{logger['info'](_0x8908('0x7'),_0x59ea19,_0x8908('0x8'));_0x557384(_0xdaaf64[_0x8908('0xe')][_0x8908('0xd')]);}})['catch'](function(_0x5cfe3e){logger[_0x8908('0xb')](_0x8908('0x7'),_0x59ea19,_0x5cfe3e);_0x4f0197(_0x5cfe3e);});});}
\ No newline at end of file
+var _0x568b=['then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x33d144,_0x4fc483){var _0x4ff4aa=function(_0x404bc9){while(--_0x404bc9){_0x33d144['push'](_0x33d144['shift']());}};_0x4ff4aa(++_0x4fc483);}(_0x568b,0x112));var _0xb568=function(_0x5107fc,_0x9c107d){_0x5107fc=_0x5107fc-0x0;var _0x4e6464=_0x568b[_0x5107fc];return _0x4e6464;};'use strict';var _=require(_0xb568('0x0'));var util=require(_0xb568('0x1'));var moment=require(_0xb568('0x2'));var BPromise=require(_0xb568('0x3'));var rs=require(_0xb568('0x4'));var fs=require('fs');var Redis=require(_0xb568('0x5'));var db=require(_0xb568('0x6'))['db'];var utils=require(_0xb568('0x7'));var logger=require(_0xb568('0x8'))('rpc');var config=require(_0xb568('0x9'));var jayson=require(_0xb568('0xa'));var client=jayson[_0xb568('0xb')][_0xb568('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x420913,_0x3a6da4,_0x51cd39){return new BPromise(function(_0x1f8227,_0x4c72ea){return client[_0xb568('0xd')](_0x420913,_0x51cd39)[_0xb568('0xe')](function(_0x3041c6){logger[_0xb568('0xf')](_0xb568('0x10'),_0x3a6da4,_0xb568('0x11'));logger['debug'](_0xb568('0x12'),_0x3a6da4,'request\x20sent',JSON[_0xb568('0x13')](_0x3041c6));if(_0x3041c6[_0xb568('0x14')]){if(_0x3041c6[_0xb568('0x14')]['code']===0x1f4){logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x3041c6[_0xb568('0x14')]['message']);return _0x4c72ea(_0x3041c6[_0xb568('0x14')][_0xb568('0x15')]);}logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x3041c6[_0xb568('0x14')]['message']);return _0x1f8227(_0x3041c6[_0xb568('0x14')]['message']);}else{logger[_0xb568('0xf')](_0xb568('0x10'),_0x3a6da4,'request\x20sent');_0x1f8227(_0x3041c6[_0xb568('0x16')][_0xb568('0x15')]);}})[_0xb568('0x17')](function(_0x1805ba){logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x1805ba);_0x4c72ea(_0x1805ba);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index f8d82ac..1af79d0 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 _0xa359=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','post','create','/:id/contacts','put','delete','destroy'];(function(_0x40b046,_0x27857f){var _0x1558d4=function(_0xbfd78f){while(--_0xbfd78f){_0x40b046['push'](_0x40b046['shift']());}};_0x1558d4(++_0x27857f);}(_0xa359,0x12c));var _0x9a35=function(_0x17aec5,_0x32c026){_0x17aec5=_0x17aec5-0x0;var _0x51b26d=_0xa359[_0x17aec5];return _0x51b26d;};'use strict';var multer=require(_0x9a35('0x0'));var util=require(_0x9a35('0x1'));var path=require('path');var timeout=require(_0x9a35('0x2'));var express=require(_0x9a35('0x3'));var router=express[_0x9a35('0x4')]();var fs_extra=require(_0x9a35('0x5'));var auth=require(_0x9a35('0x6'));var interaction=require(_0x9a35('0x7'));var config=require(_0x9a35('0x8'));var controller=require(_0x9a35('0x9'));router[_0x9a35('0xa')]('/',auth[_0x9a35('0xb')](),controller[_0x9a35('0xc')]);router[_0x9a35('0xa')]('/describe',auth[_0x9a35('0xb')](),controller[_0x9a35('0xd')]);router[_0x9a35('0xa')](_0x9a35('0xe'),auth[_0x9a35('0xb')](),controller[_0x9a35('0xf')]);router[_0x9a35('0xa')]('/:id/contacts',auth[_0x9a35('0xb')](),controller['getContacts']);router[_0x9a35('0x10')]('/',auth[_0x9a35('0xb')](),controller[_0x9a35('0x11')]);router[_0x9a35('0x10')](_0x9a35('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0x9a35('0x13')](_0x9a35('0xe'),auth[_0x9a35('0xb')](),controller['update']);router[_0x9a35('0x14')](_0x9a35('0xe'),auth[_0x9a35('0xb')](),controller[_0x9a35('0x15')]);module[_0x9a35('0x16')]=router;
\ No newline at end of file
+var _0xab50=['update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/contacts','getContacts','post','create','/:id'];(function(_0x1ed482,_0x308d08){var _0x488557=function(_0x4a5dc2){while(--_0x4a5dc2){_0x1ed482['push'](_0x1ed482['shift']());}};_0x488557(++_0x308d08);}(_0xab50,0x1e3));var _0x0ab5=function(_0x701bd8,_0x1a792f){_0x701bd8=_0x701bd8-0x0;var _0x2aa48b=_0xab50[_0x701bd8];return _0x2aa48b;};'use strict';var multer=require(_0x0ab5('0x0'));var util=require(_0x0ab5('0x1'));var path=require('path');var timeout=require(_0x0ab5('0x2'));var express=require('express');var router=express[_0x0ab5('0x3')]();var fs_extra=require(_0x0ab5('0x4'));var auth=require(_0x0ab5('0x5'));var interaction=require(_0x0ab5('0x6'));var config=require(_0x0ab5('0x7'));var controller=require('./cmCompany.controller');router[_0x0ab5('0x8')]('/',auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xa')]);router[_0x0ab5('0x8')]('/describe',auth[_0x0ab5('0x9')](),controller['describe']);router[_0x0ab5('0x8')]('/:id',auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xb')]);router[_0x0ab5('0x8')](_0x0ab5('0xc'),auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xd')]);router[_0x0ab5('0xe')]('/',auth['isAuthenticated'](),controller[_0x0ab5('0xf')]);router[_0x0ab5('0xe')](_0x0ab5('0xc'),auth[_0x0ab5('0x9')](),controller['addContacts']);router['put'](_0x0ab5('0x10'),auth[_0x0ab5('0x9')](),controller[_0x0ab5('0x11')]);router[_0x0ab5('0x12')](_0x0ab5('0x10'),auth[_0x0ab5('0x9')](),controller['destroy']);module[_0x0ab5('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 7810142..306e761 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 _0x6f13=['STRING','TEXT','INTEGER','DATE','NOW','sequelize','exports'];(function(_0x432616,_0x5211f1){var _0xbb21ef=function(_0x2106af){while(--_0x2106af){_0x432616['push'](_0x432616['shift']());}};_0xbb21ef(++_0x5211f1);}(_0x6f13,0xe5));var _0x36f1=function(_0x5c6670,_0x46f467){_0x5c6670=_0x5c6670-0x0;var _0x21e11a=_0x6f13[_0x5c6670];return _0x21e11a;};'use strict';var _=require('lodash');var Sequelize=require(_0x36f1('0x0'));module[_0x36f1('0x1')]={'firstName':{'type':Sequelize[_0x36f1('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x36f1('0x2')]},'street':{'type':Sequelize[_0x36f1('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x36f1('0x2')]},'dateOfBirth':{'type':Sequelize[_0x36f1('0x2')]},'description':{'type':Sequelize[_0x36f1('0x3')]},'phone':{'type':Sequelize[_0x36f1('0x2')]},'mobile':{'type':Sequelize[_0x36f1('0x2')]},'fax':{'type':Sequelize[_0x36f1('0x2')]},'email':{'type':Sequelize[_0x36f1('0x2')]},'url':{'type':Sequelize[_0x36f1('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x36f1('0x2')]},'skype':{'type':Sequelize[_0x36f1('0x2')]},'teams':{'type':Sequelize[_0x36f1('0x2')]},'viber':{'type':Sequelize[_0x36f1('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x36f1('0x2')]},'telegram':{'type':Sequelize[_0x36f1('0x2')]},'UserId':{'type':Sequelize[_0x36f1('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x36f1('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x36f1('0x5')],'defaultValue':Sequelize[_0x36f1('0x6')]},'dialTimezone':{'type':Sequelize[_0x36f1('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdc66=['UNSIGNED','NOW','sequelize','STRING','TEXT','INTEGER'];(function(_0x5316d4,_0x3e273a){var _0x590f57=function(_0x37718c){while(--_0x37718c){_0x5316d4['push'](_0x5316d4['shift']());}};_0x590f57(++_0x3e273a);}(_0xdc66,0x1e2));var _0x6dc6=function(_0x48845d,_0x4338c2){_0x48845d=_0x48845d-0x0;var _0x5bad7d=_0xdc66[_0x48845d];return _0x5bad7d;};'use strict';var _=require('lodash');var Sequelize=require(_0x6dc6('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x6dc6('0x1')]},'postalCode':{'type':Sequelize[_0x6dc6('0x1')]},'city':{'type':Sequelize[_0x6dc6('0x1')]},'country':{'type':Sequelize[_0x6dc6('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6dc6('0x2')]},'phone':{'type':Sequelize[_0x6dc6('0x1')]},'mobile':{'type':Sequelize[_0x6dc6('0x1')]},'fax':{'type':Sequelize[_0x6dc6('0x1')]},'email':{'type':Sequelize[_0x6dc6('0x1')]},'url':{'type':Sequelize[_0x6dc6('0x1')]},'facebook':{'type':Sequelize[_0x6dc6('0x1')]},'fb_data':{'type':Sequelize[_0x6dc6('0x1')]},'twitter':{'type':Sequelize[_0x6dc6('0x1')]},'skype':{'type':Sequelize[_0x6dc6('0x1')]},'teams':{'type':Sequelize[_0x6dc6('0x1')]},'viber':{'type':Sequelize[_0x6dc6('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x6dc6('0x1')]},'telegram':{'type':Sequelize[_0x6dc6('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x6dc6('0x1')]},'priority':{'type':Sequelize[_0x6dc6('0x3')](0x2)[_0x6dc6('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x6dc6('0x5')]},'dialTimezone':{'type':Sequelize[_0x6dc6('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f40ba88..f973b63 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','generateXOAuth2Token','user=','utf-8','toString','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email'];(function(_0x5837b2,_0x404be4){var _0x56435d=function(_0x2f5d4d){while(--_0x2f5d4d){_0x5837b2['push'](_0x5837b2['shift']());}};_0x56435d(++_0x404be4);}(_0x28cb,0xce));var _0xb28c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x28cb[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xb28c('0x0'));var moment=require(_0xb28c('0x1'));var random=require(_0xb28c('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xb28c('0x3'));var tnef=require(_0xb28c('0x4'));var logger=require(_0xb28c('0x5'))(_0xb28c('0x6'));var config=require(_0xb28c('0x7'));function getAddress(_0x34184b){var _0x8fc7ba=_[_0xb28c('0x8')](_0x34184b['value']);return _0x8fc7ba&&_0x8fc7ba[_0xb28c('0x9')]?_0x8fc7ba[_0xb28c('0x9')]:'anonymous'+random[_0xb28c('0xa')](0x6)+_0xb28c('0xb');}function getFirstName(_0x56291b){var _0x4174ba=_[_0xb28c('0x8')](_0x56291b[_0xb28c('0xc')]);if(_0x4174ba&&_0x4174ba[_0xb28c('0xd')]){if(_0x4174ba['name']==_0x4174ba['address']){return _0x4174ba[_0xb28c('0xd')][_0xb28c('0xe')](0x0,_0x4174ba[_0xb28c('0xd')][_0xb28c('0xf')]('@'));}var _0x422cf9=_0x4174ba['name']['split'](/\s+/);return _0x422cf9[_0xb28c('0x10')]>0x1?_0x422cf9[_0xb28c('0x11')](0x0,-0x1)[_0xb28c('0x12')]('\x20'):_0x4174ba['name'];}return'Anonymous';}function getLastName(_0x2e578f){var _0x3d19bb=_['head'](_0x2e578f[_0xb28c('0xc')]);if(_0x3d19bb&&_0x3d19bb['name']){var _0x467af0=_0x3d19bb[_0xb28c('0xd')][_0xb28c('0x13')](/\s+/);return _0x467af0[_0xb28c('0x10')]>0x1?_0x467af0[_0xb28c('0x14')]():'';}return'';}function getMails(_0x338983,_0x4ac793){var _0x103b2d='';for(var _0x51feb1=0x0;_0x51feb1<_0x4ac793[_0xb28c('0xc')][_0xb28c('0x10')];_0x51feb1+=0x1){if(_0x4ac793[_0xb28c('0xc')][_0x51feb1][_0xb28c('0x9')]!==_0x338983){if(!_['isEmpty'](_0x103b2d)){_0x103b2d+=',';}_0x103b2d+=_0x4ac793['value'][_0x51feb1]['name']||_0x4ac793[_0xb28c('0xc')][_0x51feb1]['address']||'';_0x103b2d+='\x20<';_0x103b2d+=_0x4ac793[_0xb28c('0xc')][_0x51feb1][_0xb28c('0x9')]?_0x4ac793[_0xb28c('0xc')][_0x51feb1][_0xb28c('0x9')]:_0xb28c('0x15')+random[_0xb28c('0xa')](0x6)+_0xb28c('0xb');_0x103b2d+='>';}}return _0x103b2d;}function parseEmail(_0x2fb1cf,_0x561237,_0x17d832){if(_0x561237[_0xb28c('0x16')]){var _0xc8345b=/